From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 102A125C99 for ; Thu, 14 Mar 2024 04:47:31 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1710388051; b=Jbll3ogu6AiirsDx9qjvfthPlw8JkunL9CddF99B5wkpx6Ga8m+nWAHljwkrxeB/4PujNRtBGB yynapS1le9Sz6SaNHXDt6I6tsDpEpOESjIgHkR6+AStfEnV95g9ufs3qGbZ9S5miClNaUDWvf6 A/TJy1vYJ4Od0wPcnhzuIr/3KkAjOXol4e8OxF6aBi9Z2+lv7x/C5j3DM3RnUDZWmdvX2ORGOP C0MDDPQDonB06AUCMCUU6We6iDjFkmGbIElV2dGHoS9UykHSaPFN6J+kFExqOk7WzvAlz2V8zq rxiDc4QniJ4g1d4TxxGKAAYrKQN3qNSOs624cxZYCxs5Ug==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 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-20210803; t=1710388051; bh=zZQ5XKjrc86dm4TlLkXFps+Dnt/Msc/3HWzilQtUdsk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=oaNcIrmzfi80rmzmVhzJaoShStWmSqPs6UL8Co52CPCgFNjr92zsZi4CZRtZORrt0Cpewil7JE QROES/DGm1DPu0ILHfeErEuBDJF4N8fo9nIZiOLa+p0ctQqQdZWEjuHtCfhxQ0qXPu7FFUe5Ao aN5lomf5oRGhXFAGoLm5B/vabpbvANGCIiPxtUp4KhswTip0l/oi2sFLz4K6f/AvJqXcz2wZrv Q0HCQvzA6FJB/CtKSZWkvl0UPG9XwxWTGZ7A6AqGG01Bg3jDCZFX85u3kqbqRjVqa3AiyrQfFS DFWjx0lRlvlNNadALTzLaDSP66CVMfYAAyXTJof9uAQc7g==; 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-Transfer-Encoding: Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=C/kfanxWyGjymE/3JxwvqSf99AKAJn9HzODafFhhKmM=; b=OwnzFQdHaD4qcZnMzGXQdz4+Dk ppZZ1efXiRQQOzUlC0GGMsKJXc1CCgQxb1XtCLT63Viy/UwkluKIzLRTagpake9oAESBFWc/qWOEm b4fElcBBhpACWuGcIeocYJpBSN8kz3J6yxR7k/Q++W9yV9rgvt9dEq4rgKdp4qWqKN7NStbEwCsiD x3u4sMNFCuJvcfv3cun3V3guS+KD067226TUVQ4/Nze1fmuZawok8aC1KqrRLLAfg84Bdk+NG9qU3 84I3sz5LwdMw6nyxz70h0zujUCAsmqdirdo+VCHsbta4OfFiEBKvIe50C24e0QA4hfaIP7EX9wezW YlWmiXGg==; Received: by zero.zsh.org with local id 1rkc42-0006R2-Oa; Thu, 14 Mar 2024 03:47:30 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f53.google.com ([209.85.218.53]:42287) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rkc3Q-00067D-A5; Thu, 14 Mar 2024 03:46:52 +0000 Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a446b5a08f0so98721766b.1 for ; Wed, 13 Mar 2024 20:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1710388011; x=1710992811; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=C/kfanxWyGjymE/3JxwvqSf99AKAJn9HzODafFhhKmM=; b=JzQNZe7A2G5kEvJz58sUKWkBJrEY8JLj4jbg+u3LbZyg6BKQp5QLQFmpY860cIudu7 UkH4KLA45IBth6rTuDKjnmWlG5/eC93WJ9vZ6DAFJiy4BP8FlojL7wiUDhcjOOq9uLC8 2tbUbEcCKTfK/Elr4po49V/yvcYSQjgFypJ9SwwHSrzvvZe8pVA6ouUPo2Va2pAZEI/x W5wDWCDSoPCMkNKSB1qO/2/NENX66/ZpH1453jtu3nG72Sr+8zgJf9Zrdoa4XleJB51y 50TyP/E9h/gRO4S2gYgUOx2xjD/MzAUsYotJWynRXEtFwbbPmrUnkikOTJF0DRi1hwlc TtAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710388011; x=1710992811; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C/kfanxWyGjymE/3JxwvqSf99AKAJn9HzODafFhhKmM=; b=RuA2wW0ohyDFz6kjSrNiIwtl05hzW22Bj6mM8ZherjjI20bymOENDd+LHzOB7gE9wd p/K8Nn4imBkTU1mSAB0Sskxa62hSP6FtLItZotBd7pul/BTOuqcjlXRKqm7gMaICyT8H VitF6o7wPGeJyjuoXMxUeJUDyLdyKcQUeu0Ohm0HmfgAe9FqUUA6MocVLptJtCcm93Wo RJGkiWFDuxsbxdicRMKed3j9+uq7ZxM4/4hO0U9c9dGudvEwUGEVvoi3TiG5VExHVoTP yDPxoTbyltMazTxGx2G43hdmpo2CbgyDlzja+gRNrtoGoRiacn/kdgnVp7qkOD2VzRBS 0JCQ== X-Gm-Message-State: AOJu0YyFIjJ/z7jTjNpukEuz4vCMlecz/8HapR7VN+Yxz0/ckmcHujlB QJnwVrTmANfE41YnNvBCrEm0wptqDrMWyXuJAKt2OTOz7bEVPBq+J2PGf8QyjN0TU6rC+XpuPO9 2OhkBX+IcNMRhXjN67VSXvjrcKiF+zDvuYvXjDlTeVqye9tA6Kw== X-Google-Smtp-Source: AGHT+IFwb9CI1qlk5I4iuo1Oe/AnS+3RQzb63P1U/R5dZY8jDfkAEzqTOAj8+UNtlLPxc8s8ImGAmml+40xkaMu+AHs= X-Received: by 2002:a17:907:c1a:b0:a46:4cc9:765 with SMTP id ga26-20020a1709070c1a00b00a464cc90765mr5309664ejc.7.1710388011452; Wed, 13 Mar 2024 20:46:51 -0700 (PDT) MIME-Version: 1.0 References: <20240313161732.GA3513530@cventin.lip.ens-lyon.fr> In-Reply-To: <20240313161732.GA3513530@cventin.lip.ens-lyon.fr> From: Bart Schaefer Date: Wed, 13 Mar 2024 20:46:40 -0700 Message-ID: Subject: Re: nocorrect documentation and behavior To: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52753 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 Wed, Mar 13, 2024 at 9:17=E2=80=AFAM Vincent Lefevre wrote: > > "nocorrect" is documented under "PRECOMMAND MODIFIERS". So it is > surprising that it can affect more than the corresponding command. It's documented there because there was no better place to put it, I vaguely recall. > Is this the expected behavior? It's the implemented behavior, at least. This is an effect of it being handled with a flag in the global parser state, which does not reset at subshell or command boundaries. This is hinted at by "with the exception of nocorrect which is a reserved word ... interpreted immediately, before any parsing". Conversely, as I think was discussed not that long ago, spelling correction is applied during parsing as soon as each full word is seen, just like alias expansion. > Spelling correction is not done on any of the subsequent words > of the full command line. [...] It also says "A simple command may be preceded ..." which is equally inaccurate in this case, but there are a lot of bits of the doc that colloquially assume that one interactive command line is the same as one "simple command". diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo index 915b93bc0..b80f9750c 100644 --- a/Doc/Zsh/grammar.yo +++ b/Doc/Zsh/grammar.yo @@ -100,14 +100,15 @@ More generally, a list can be seen as a set of any shell commands whatsoever, including the complex commands below; this is implied wherever the word `list' appears in later descriptions. For example, the commands in a shell function form a special sort of list. + texinode(Precommand Modifiers)(Complex Commands)(Simple Commands & Pipelines)(Shell Grammar) sect(Precommand Modifiers) cindex(precommand modifiers) cindex(modifiers, precommand) -A simple command may be preceded by a em(precommand modifier), -which will alter how the command is interpreted. These modifiers are -shell builtin commands with the exception of tt(nocorrect) which is -a reserved word. +With the exception of tt(nocorrect), which is a reserved word that +affects further parsing when it is found in command position, each +of the following builtin commands is a em(precommand modifier) which +may precede a simple command to alter how that command is interpreted. startitem() findex(-)