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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32278 invoked from network); 29 Dec 2020 21:49:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2020 21:49:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609278541; b=GWO5iFiDF0MCFIW6yAf6QtRKSgPBwgV9FHWgTu17faPIclMGXvMPaeWtvSQ7sHkBH/xnwfoCL2 InF0m5QAOposAXXNQxpmDdjjDlS2Gqd0ri6eSzaz8oFkMbkcmrSI53sRvlsNgSxikbRRTLZe+t 4Bw40vwFqSz2Jc934M9lktshhdQvAUCKNqw0GGGURUoq4GzAYzunwZwFbmidOLme6XwQp0dKHC 8qbHjGq55mgS3N/enYHQOsftOLrnQbL24grY7MuH4R7D/atateRP21qvG3RTp4k2jy14EyRdyV rEaIHF2NxnU1rs8c6SU1UWUdQf8CuUUjqgpSkLCVPS+/IA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f41.google.com) smtp.remote-ip=209.85.210.41; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1609278541; bh=7SVWK2uLHN3kTS00Gh1xvMg5X9O9UB9vNKrTJNlegng=; 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=SQgJ7A1JnX6KhfyogDvlJ0LVsLXmo0AzSNu6DIkezsOsIdMmlFC6b70uN8o+jE1sKUOjT24ajb rt62tQp06MNSJEdJETOUPhrmfHDJ/TRLc9B9ePxHzdwVZrnKNnbN7r055XFxRqERG5GE+RoWUl pxmRS1BK3I0tmsjZzGkBPgeZxI/p9g3v8S7br7br6MhtdIvLtZqSv+kgZi/uKFvwHCDTTvNMs+ iZp3i3jQa2TamVRIQwuGHOa5up3Qd6k4pyFzQs1HgwhyoOl9sHp5RxgdarxJI8z4cdKXJndN0d JeaowPZEtyBQQC4x7UULKpPyoQRttLb6BJ/QxF8LgVGNDw==; 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=mkOFd+vsQoXxuSVgy+2DhmTP1QCDlXwusGrck53mu6o=; b=Od+c27HSO8+yogGwT7trIKAwu1 7rIHW5b6vRypw57gcM4ovQQ5JqIkBBRQ9FeHIhe/vka82ZlsAukG3/R1m2UXk9mN8ozkWLqGZ3Yjc MCI86MPTpfx2MWKha8WrrTPVHWu4n9DkSqeoSlJhOzUe6/HXchRm8xdK6bJP6XjIBXLkcaYAIQsz3 4hzbzNW8F64XgwVrjUvf29Zy61sO7IhLHakZsGJGJ5sa5hiWRvyS2HXQZ2IC53xja6ac0vZYOsZSV TRY/NdrcUWW+pVPqbZNxIye0AKRy/AfSQ4yNL6j53sE6H6ONHDPeQ5YADf5CBinvX6e+Fgn9m+RTz M4NNE20g==; Received: from authenticated user by zero.zsh.org with local id 1kuMrV-0004Hj-LM; Tue, 29 Dec 2020 21:49:01 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f41.google.com) smtp.remote-ip=209.85.210.41; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f41.google.com ([209.85.210.41]:40850) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kuMr1-0003uO-R3; Tue, 29 Dec 2020 21:48:32 +0000 Received: by mail-ot1-f41.google.com with SMTP id j12so13320667ota.7 for ; Tue, 29 Dec 2020 13:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mkOFd+vsQoXxuSVgy+2DhmTP1QCDlXwusGrck53mu6o=; b=vq/pl2BTd++aXBLYwdByFHzBM3A1aVZ0yvTxSXcYjek1FPbuwl/yqY9dHaFAoZbzTs h0iTOZRox7SLboj4gxuTWUBs4zbsSQfrekjwfNvNalXhr3L+IUouELh+OWJMTRZNpn1E ReK3SmP6gXtdGplAsPY4ppg3KoKiA99zUZ8Gq0txZYq5ca+ZL+DA0ldJij2LLXhf3Hpm 9RmYuKUhfGAs1LJh+/1HVaRZ7qPl12/PysPtOWfQ49W67mdmd4q7U1qeOB21xltyuX/t AX02AxTTb2fcJOe/wjIjO0J9+gFwvQVQjgxJ78dsd6ijokinVMTDo0Mrt0Zpof2lbpZJ YhLA== 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=mkOFd+vsQoXxuSVgy+2DhmTP1QCDlXwusGrck53mu6o=; b=avQdN0wkdNO/1uXKsS28bQzmpJBI8j8zy2+Do81g4E9RgLyH1PSWWR+YylUuPFeM8i QTsz7CBFv70YLCtKYUkxSxgIOkiYoSYbt3CLbFqTm/L9zl2YeeHnAHnDvz4jcdgvtiAS /2B6ia/tj2vyGmrIES8QaYYqalz69Z6KYERMwbitWaHZgoB1N0GzfhKjY/kcp4nC86uG 5pKwf7J9uT0ufIYHPlaWBrBgcnMDxWTconWdXdMw5PodNVEY2yORL7vuODlJ0Evx3DSd njG7FYKVRTrlg5qmFKc62jjQWUNy0lOI+fu3/kLRel4i8hDF8FHGWfMEWfJpVIa8OsOp VRkA== X-Gm-Message-State: AOAM530N4HUzmjGucUOENSfvfCUDjc8xvBck0moSfZMlhdYC7nlddEpZ 9MjSV9TpBBjwEs16RhS/+Rkuy+yaBjci/+e+MJcCXo6yf+0R5Q== X-Google-Smtp-Source: ABdhPJxlqWtRjWRUnKsAEkGG4jq8tHcgGgs0U24Ab4FbZSeN2oG9w5YjGJmvr4FU4GIsRwU3/swXejUSYZxhoTmdIEQ= X-Received: by 2002:a9d:470c:: with SMTP id a12mr37045452otf.161.1609278510104; Tue, 29 Dec 2020 13:48:30 -0800 (PST) MIME-Version: 1.0 References: <819ec6fe-5af2-2e97-c5bb-f434b1de86d7@eastlink.ca> In-Reply-To: <819ec6fe-5af2-2e97-c5bb-f434b1de86d7@eastlink.ca> From: Bart Schaefer Date: Tue, 29 Dec 2020 13:48:19 -0800 Message-ID: Subject: Re: completion within a function To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26267 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 Tue, Dec 29, 2020 at 1:04 PM Ray Andrews wrote: > > func () > { > code > cd $1 [TAB] > code > code > } > > ... so that I can automatically execute a completion within a function. Where does the TAB come from? I think what you're actually asking is how to apply the contextual completion "rules" defined for a command ("cd" in this case) to a parameter expansion. There really is not any way to do that "automatically" because completion is tightly bound to having the ZLE line editor active. It could be done the way that the test suite emulates completion, but that's exceptionally convoluted, especially error handling. > 'vared' is a variable editor no? Does it do more than I think? If you were to write func() { code vared 1 cd $1 code code } Then at the point vared is invoked, func would pause, wait for the user to press TAB or whatever, and then after accept-line is executed, continue with whatever result. Yes, you actually can vared the positional parameters. More in response to the next message.