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=-4.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27469 invoked from network); 29 Dec 2020 21:05:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2020 21:05:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609275914; b=y6t0p6GVUezMfN+KvhPT/EGtKX2Ou2uRZR37zGf+PJ/Jn267CNQ47dFOEpEaOU/tjb2/2w4JDP evKGRMNKWHMpR/u0zt8z7IQd+xyn7xbBkY6YoezbWnRoKyklmKTxNHAN/fxY1e/JphvRhOOGaC ZRkAaUiQij0qKOhQ55wWR/cOZIAKslD09shMSA1uDRS0OuVOKwZwtNRyGU+Q1xi480HkvZMTT1 QUrof3JAdBVzH/AyeOEzvY5NvjXuWjCJN6W4+nf+LfXWVAlAFB/Coc+nFqeL+xOWSItE0O8tgx edaH68WOd8f0OKzQyJUw6SoHsZBhzKhfBjsmQRonKb6DKA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1609275914; bh=u3rJPdTdTrYGzTURywYrF/Map9759/leD0YXNkywaN4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:DKIM-Signature; b=hF0l6qvwpuUOEnxbxLTb/jxm1UTKRYM64O6MqzQ/kSS23RwYlS6cz4JvAJEnQFzz2GFYZBmmvZ l6yXpfADYIlvqut3d4bQF+ybiQsauhqvAgrROIvw7tqRl2J9iqAhT9MPKweHGHhnLDsS4fxO1/ 4bITqfHn1E3k6fj3PASiKAB6SbF4WchkUtpvt3IsnxRUvMoJ5RPM+Iv2ac0L94DlEx2GgfC5aB n+IlDe/A0xOck040snxPQ5WeCPkNuSGrPMoU0uhIsSPW2p0LAi2DBy73WykYIQJVO2KUyRWmOx F2Tin4H3cdrRaQKQeg0VkxNMNLljMLti4xTp1Lye/aH8gQ==; 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-transfer-encoding: Content-type:In-reply-to:MIME-version:Date:Message-id:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=0+lk9jpV8GfQHtM9WhqxDFrJX9mbMnole2sYZEGIYhM=; b=VxZ7Nv4uMTk4MAVStyDkap6fNX yG00ESiOLe00NQzukle3bL3pvIOR6OgW5QRlF5QIs4XSyFPD1P0RDmW4LTc/Rl8BYjV8bMDg5aSWW 5+FOumadLTFXSsfLqcVEYtsJTcCfPGow8bQht+2GbTGITm+3LLIectKWHWbnqE86P2rH8FCiNALe5 L2Fpyy5fjov4n2RTmoxn/rs69ihHSJht9x4VPNtoAe/kkWwMIek/lMTL7C6DxRFg6mvTxmcurQva1 HsufITcJnlRGq5K+9amJVBSdhheVpN2UM/ymeNLJJYI6MOjaPCsNELJfi/0mkKYbX5iqrkYrODr31 eKxp1ZYw==; Received: from authenticated user by zero.zsh.org with local id 1kuMB7-00028w-Ci; Tue, 29 Dec 2020 21:05:13 +0000 Authentication-Results: zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none Received: from mta01.eastlink.ca ([24.224.136.30]:44391) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1kuMAa-0001lB-NJ; Tue, 29 Dec 2020 21:04:41 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta01.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0QM400F4Q5DB5930@mta01.eastlink.ca> for zsh-users@zsh.org; Tue, 29 Dec 2020 17:04:39 -0400 (AST) Received: from [192.168.0.3] ([24.207.90.194]) by Eastlink with ESMTP id uMAYkTNBw6iEuuMAYkYEQc; Tue, 29 Dec 2020 17:04:39 -0400 X-Authority-Analysis: v=2.4 cv=HcDR8gI8 c=1 sm=1 tr=0 ts=5feb99e7 a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=gir0-LH0AAAA:8 a=LBT13T-K0cuqOLDR9fUA:9 a=QEXdDO2ut3YA:10 a=aLewGyoHDmJ4ULJHWpSz:22 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddvuddgudegiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeekvdeuuefffefhvdeuieetffdvtddvjeegueejkeeiudehieetieehgeetvdfhfeenucfkphepvdegrddvtdejrdeltddrudelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrledtrdduleegpdhhvghloheplgduledvrdduieekrddtrdefngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhg X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.90.194 Subject: Re: completion within a function To: zsh-users@zsh.org References: From: Ray Andrews Message-id: <819ec6fe-5af2-2e97-c5bb-f434b1de86d7@eastlink.ca> Date: Tue, 29 Dec 2020 13:04:38 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 26265 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 2020-12-29 10:52 a.m., Bart Schaefer wrote: > On Tue, Dec 29, 2020 at 7:24 AM Ray Andrews wrote: >> How do we execute a completion within a function? > Depends on the context. > > If the function is already executing as a ZLE widget, it might invoke > "zle recursive-edit". > > If it's running as a command or from inside a script, using "vared" to > read from the keyboard into a local is one way. > > There are examples of both of these in the Functions tree in the distribution. > I'm looking for something as simple as this: func () { code     cd $1 [TAB] code code } ... so that I can automatically execute a completion within a function.  'vared' is a variable editor no?  Does it do more than I think?  Even tho I've turned off all 'smart' expansion here, what would be cool is to have it expand only directories and I'm betting I can zoom in on the exact code to do that. I presume Ray wants something like "complete ma", which would return "make man ..." essentially everything that typing "ma" would return. Yeah, just that Filipe.