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 17151 invoked from network); 30 Dec 2020 04:35:51 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Dec 2020 04:35:51 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609302951; b=tC70mDood2EJhyjm1gWluKz8AnchseFPpyhNqUEX/+eQS0Oy0HrVO/pjgfe0mF4od37OA42pUx +o8iRAoGGU3nG/c9eMxzd4em2lcK+sSRlXL39iZetSG6rzr+Zl+Dup3AlxtuxEf8ScghZSB8c/ STHBLJ7y0lR0UcEtERYnzFyIhEIB2ZJi/BoqE+dgjcUuQP8SaNKAsCKQ12Znaj3KzB6SmjOOuu oXUtg97gbBJrbtkdD78qWexYKmtIXQnsIigSqlauSWNuZjGxxu8jzokyusBfa8HfqvGsL4M2+g 3uyzAzIdALONkBevNFPN7tQpiVVZ79h30JnOyvYqoVohVQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-il1-f178.google.com) smtp.remote-ip=209.85.166.178; 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=1609302951; bh=5wknyZx5hCkoghK7V+IAkfPx2j3G4o0i30TWm+R1dW4=; 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=IBczsZEc0AqF8wLGJOFUi0/wbiNOMKnyh8vNKhO3NyGgqN5fzKknUBD2yWOJtHT8APsW64MTV3 w4DOXWc9YNPkx1sSdBS+vkeX7EbmiLVvlrJAwTtpQAWSK98zUfWqGXQio7/OiPpPS9h2FazZ65 SCLBDjvfj3yNFPXM2w0NAwEnqrVtcJxSfIZbkwH/0ttFC21drhgImnN4K7hXvTygNcZoqQbbH6 HfrGHFkp+VVOdR4vlmoMNuoucmyczKhs2/OVw6NFttQhiEGb1IfSrVLRImJuE8+ApIa3/gSUa1 1XDFVHSuWPeeP7z3JNlYVultYqOMYlprGQ7vsx2c9sY/lA==; 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=I0m5CJeuzCKySbMZ1Af+/sapequ/Ma5kXQg7EM96Uvk=; b=SF1TQGitzgHj/GYXURPToT13TB JCasW4rnxORTT8kqVAiNshl9cNjTd5IqEBe0qSotfagtuAs7GfFFAzPG1A2P7d2ANOkxez034VCJ2 YNSEhcolQQnm6eFEmCCveDOm+IrvNUnn0WZNV2UTTBw26wTQ6XUrJivUiqF0iMWGIZEKQi2u/JeAl Vj/ZAsxftGjEjl8vyL97mTSGmMTYT8KfKPQGBUMMByXuBRmrJp6/CMdm90ywWWqexUA60qJ1Cls4D Vl+QiUZtSLdoAm2X717zh1aihiEgd3xCvP28oggNWkBpuEDiDSvEEvIwrLmr7KFVJ9naRF89kGkA/ K/rqa3sw==; Received: from authenticated user by zero.zsh.org with local id 1kuTD8-0000OG-EZ; Wed, 30 Dec 2020 04:35:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-il1-f178.google.com) smtp.remote-ip=209.85.166.178; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-il1-f178.google.com ([209.85.166.178]:39885) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kuTCZ-000Q0N-52; Wed, 30 Dec 2020 04:35:12 +0000 Received: by mail-il1-f178.google.com with SMTP id q1so13889116ilt.6 for ; Tue, 29 Dec 2020 20:35:10 -0800 (PST) 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=I0m5CJeuzCKySbMZ1Af+/sapequ/Ma5kXQg7EM96Uvk=; b=pX3eCyoLrqBYW+RBnRYNGwlyr0/1xK69BTrLr+2E5miQI99vHeWqkuBOK8jXeK8iGN PWQzpmIqzBZOJYgTTttKk16j4zdlDA3ZzmzgWB9V1U8Z8ETaUf7Aw8XW5j6GXuT/BeAo aZoxlDtu9r9HM1WMo+32SUo8GAB3Uq88sTY0h7M2ffspszEXlj5OLHBFLNpEWMt1tyH2 rM3saah42iykLLKtkoyczi9HPJ/kOE2kTFdOBvRHzokhp3RKmhfuom33a0DT+bHibLuM lnEI9CxvLwmi/p4chxE2iAcEpuGuNiL0uue8nwQmgc52ahOLT6lADLIao50vVuLB8tC9 3k1g== 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=I0m5CJeuzCKySbMZ1Af+/sapequ/Ma5kXQg7EM96Uvk=; b=Z9EamGrBAA5y/sDHQYR42IACfzyiES78kmlEXPXHbxG6CrC3iezZLJ82/LbwVQF/42 Ggp9nanxD7OT9upEvBqLEolsOmpRnV1pd9CUtYtS6YlSUJxhVl6qzR640WRnHneT3Its V8Jll82qyPLFg1wizD4ppc3YccB5D2C2Rv5i8M/iZKrs55xiRVFQuJVd+ASjtxAN5sRt XX7Ankar96ivMChqRcdC2Zy66RIbuHF+0DywIH0hrkhLJEe+pwSildfylBCEK4M+F8A8 cV/4R6R3HKD4PNcpDKoMxPji82NlDH5+CRZe+e9BYBvS668S7OtTuHBgnGmoOO39C7Yp 3uRQ== X-Gm-Message-State: AOAM533UJpYd1kvVM/ujzRBe8Kauk2zZKisfPrtmJkixdqIG5BU8mGUh dFTAi8HQQv/DnqttKhxL9FnJsfg0R86pGt+r6Sw= X-Google-Smtp-Source: ABdhPJxiALcqllE0P/ZwT3US7FBl5+1y2ky1I48TnJ7yBZkVM9H99hXWce8zNRA82FyNDjnF7aiZIUgy/22VJkCYdcQ= X-Received: by 2002:a92:d1cd:: with SMTP id u13mr33468072ilg.186.1609302909566; Tue, 29 Dec 2020 20:35:09 -0800 (PST) MIME-Version: 1.0 References: <819ec6fe-5af2-2e97-c5bb-f434b1de86d7@eastlink.ca> <520ce98a-4394-726d-3d12-8ef414e881c9@eastlink.ca> In-Reply-To: <520ce98a-4394-726d-3d12-8ef414e881c9@eastlink.ca> From: Roman Perepelitsa Date: Wed, 30 Dec 2020 05:34:59 +0100 Message-ID: Subject: Re: completion within a function To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26270 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 Wed, Dec 30, 2020 at 1:44 AM Ray Andrews wrote: > How could I simulate the effect of completing > on $1 within the function automatically? Or perhaps: > > new_var=$( complete_it $1 ) > > where 'complete_it' is a function that does just what TAB would do on > the command line. Where and how do you want to invoke this code? From a non-interactive script? From an interactive shell by pressing a key combination? Something else? If there are several possible completions, should comple_it return all of them? Show a completion menu? Fail? Something else? Should complete_it respect all completion options and zstyle definitions? It would help if you can describe what you want to achieve from the user's point of view with as little presumption of implementation as possible. Roman.