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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24328 invoked from network); 30 Aug 2023 00:26:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Aug 2023 00:26:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1693355210; b=mGzBIZAZAjrYgRUONtEZumZ1wshuudyKpctzRxrnMYuPqdKOR54g3CIccdvthulrvhz5zPsnTy fQ1DH0i5BGeHXCRX2/4edDKPRxVi2kq9OdoLwUzxIoVmU5xF+9YA1b0Uv9IXWotXIE6h6xyJh5 d21OOXYG+SvmWJrbZN/W5ERxOK8Sj2z7tKX7jvPmwXUZT1QOkQrObwML8AfF4X6EVfwjAU/Mhq f4zaHZ+276QJV4B4mph8P+8wOMj+CisQAiWLY7P3fYfuC4BIBEcDjm81xEkaGzT9fLlruEL1+f oE5NNTm3ztcREcO6HUcKm+QyIjRwn0wJA24xlfCpHTiMvQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out4-smtp.messagingengine.com) smtp.remote-ip=66.111.4.28; dkim=pass header.d=dana.is header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=dana.is; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1693355210; bh=ca++E0UstH4C6w2nD4tXzJLu5f3IkUIBXnYEELPmPUs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Subject:Cc:To:From:Date:References:In-Reply-To: Message-ID:MIME-Version:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=CaSyF2Ux9SsKgOUXSbtwVZdjplnJdBoLokm64a4+B1WqP/jaBFT8TFXf6HYKQlK8EhX0eS18ol Ea+j4z6MboqS+Wlh+gXEFsffcXBB6/ew4+smhJvsli1Fv95+xutXSR/PPsFd6Y7vQgMcdkKJ6t vTtRtOZGUundIvHQ3qSAxVcOQEiuggIGoz9vKok4Io0SZUsYPeW65V5DDjXIcd3sRXpFY4iC3b 7g41XNoiSDq96NJW9PLfIPHXahbA0tMU4FPvITNskjF+BP+RmHK3AG0g5PQQKJGOAGPO+v+DJH loUWA+iip9vU72KP8aLmSQ12HeiJyeKDLwHpQZg8UtUnsw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id: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=KbixoCr8/lH+4xgw1qT0h8Uwa5fgX05tF6yCLc5i6GE=; b=V1OX91l5WBD3RrrjBNtBhZlYP3 Mn8+nMDPYgLGFpoyB1Cs6GhUvCHsOVJsyQupXT3vZ/SazX4YT4+avfYw366wxCOGkjN3/uMMuZqvE voUk4LGjMg3fPUh+0QVkyU1pU4zHMyWq3EfXtUbQL9p8rgHL3mrFvrFCHy4+kjsLs0WMvZj0HZ6L4 YqbaO50mfZwyGSc0SbwUtKpHB9foFi8UD5p/Mu64nCS8KMklEKgF75JG5oVstZbmbeIhF1TQ5XC96 gkojdxE2btMJg2Uytcn2By7Gp5M1X7kdDgJv7F/wcGjNkVOHRIsJkpGfQr29sD6HVFMrLqC58RI9Z fJft8USw==; Received: by zero.zsh.org with local id 1qb92m-000Hx2-Ti; Wed, 30 Aug 2023 00:26:48 +0000 Authentication-Results: zsh.org; iprev=pass (out4-smtp.messagingengine.com) smtp.remote-ip=66.111.4.28; dkim=pass header.d=dana.is header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=dana.is; arc=none Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60807) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qb92V-000HdK-1z; Wed, 30 Aug 2023 00:26:32 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C6F175C015C; Tue, 29 Aug 2023 20:26:29 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute5.internal (MEProxy); Tue, 29 Aug 2023 20:26:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana.is; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1693355189; x=1693441589; bh=Kb ixoCr8/lH+4xgw1qT0h8Uwa5fgX05tF6yCLc5i6GE=; b=SNdkwfdDgxWlcuGMDQ vxbv7c99RnuMKwfEtFt9J4NczM/njerghhpzEq5cBPDrEt8eFfYp43a+WRvGJ+Wn kYByGoaBXMMDB0GuV/3NAsP4mLAjc9ZrBYId1G6JxWK8ZKkDH7cm9k07SYWQ5tWd ut4TdvkdlDQF9wK1o7hDQPR1+Bivcn87T3JfvosXI6OFzFkGTgpCkVKNhasbnEMq 6yXU0RUjzGBjkMGYVDJw1Y6E5EfAk3qWEFVlbRkcc8WTxdI9We7WiRvYaZ3Grh7e sI0JosyPr8t3kFctJX7g4uTkYEdg3ZHzVeb0W39r7cWKOSdJuTLtv6DgkAqrr3Pe 4Lyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1693355189; x=1693441589; bh=KbixoCr8/lH+4 xgw1qT0h8Uwa5fgX05tF6yCLc5i6GE=; b=TrEirOPj9U86zCu3viflV8aKq+78y 9ji/XvdIBNOjN59YEIZe+y1UNzNJidI85eznNEfA/l8rQLfEkFXs+3hUtlIahG6s VUh7pIDPl7YJB5AKQYblMIdSP7V6Nmynhth53o4qgiKKFs7i7BnZXupuH4Gs/O3K L4DK0b8IyQlWL3zIsGRwgucJVuH/acPBWXF70vDTZjZ+1r/mBNi2D0tPO3BotTo7 riZ9v9qB9/UXc2yG7pzsfFNihg56VOmZLPR8+Qj5lX1JsDTlYbMDgi6wTzdKEenT psQrf9yVXAKVc4GLmGL+c4oJ3S9adCBx4fz78PvQx+yFZ/cWRc6u3Gp/g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvvefutgesth dtredtreertdenucfhrhhomhepuggrnhgruceouggrnhgrsegurghnrgdrihhsqeenucgg tffrrghtthgvrhhnpefggfeifeetueeutdeitddttdfggedtleevjeelgfekteekhfekgf dtgeefueelueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegurghnrgesuggrnhgrrdhish X-ME-Proxy: Feedback-ID: i9be146f9:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 996591700093; Tue, 29 Aug 2023 20:26:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-701-g9b2f44d3ee-fm-20230823.001-g9b2f44d3 Mime-Version: 1.0 Message-Id: In-Reply-To: <9A3B6734-18A2-4F18-9536-C8B5A9C535BA@kba.biglobe.ne.jp> References: <9A3B6734-18A2-4F18-9536-C8B5A9C535BA@kba.biglobe.ne.jp> Date: Tue, 29 Aug 2023 19:25:48 -0500 From: dana To: "Jun T" Cc: zsh-workers@zsh.org Subject: Re: adding '-p precmd' to _normal Content-Type: text/plain X-Seq: 52108 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Mon 28 Aug 2023, at 22:55, Jun T wrote: > If anyone knows any reason that this two-step method is > better than '_normal -p precmd' then please let me know. I don't think there's a reason to break them out like this any more, usually, thanks to workers/44200 and workers/44201. Matthew updated several existing users of _normal so that they wouldn't have to, but must have missed the ones you mentioned, or wasn't confident about changing them for some reason Related: It's not really explained *why* using _normal with -p has this benefit. Attached patch addresses that PS: Currently it doesn't matter that much because we usually don't care about exactly which commands are in the pre-commands list, just whether there are any in there, but technically it would be more robust to use `-p $service` than to hard-code it like `-p env` dana diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 33baeab49..5035097bb 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4389,8 +4389,10 @@ the functions for the fields if they are called. findex(_command_names) item(tt(_command_names) [ tt(-e) | tt(-) ])( This function completes words that are valid at command position: names of -aliases, builtins, hashed commands, functions, and so on. With the tt(-e) -flag, only hashed commands are completed. The tt(-) flag is ignored. +aliases, builtins, hashed commands, functions, and so on. If the tt(-e) +flag is given, or if the list of precommands contains a non-builtin command +(e.g. because tt(_normal -p) has been used previously), only hashed commands +are completed. The tt(-) flag is ignored. ) findex(_comp_locale) item(tt(_comp_locale))( @@ -4776,7 +4778,11 @@ functions) regardless of prior precommands (e.g. `tt(zsh -c)'). ) item(tt(-p) var(precommand))( Append var(precommand) to the list of precommands. This option should be -used in nearly all cases in which tt(-P) is not applicable. +used in nearly all cases in which tt(-P) is not applicable. An advantage +of using this option is that it can automatically signal to +tt(_command_names) that subsequent completion should be limited to hashed +commands, which is usually the desired behaviour following commands like +tt(chroot) and tt(nohup). ) enditem()