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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25721 invoked from network); 20 May 2022 17:46:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 May 2022 17:46:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653068807; b=IBCo5Ji2lTjKPy44jItXg+oPzd4lV3h8dWSTayKTkbGzLVvd1gqYDK+Fwrvc4g+4yD9+hJRJjL sDps9S8fdiT8pVNaj8W4xuPFHuFFDnCOVg3cl14ZOvaf+eUV1x+yPMV4qHPK+utAM4o3XRzHOj sNbjaSPpJE0eKS2Q7wXBE39iw42q2EusgVyY77+EqS4u5A0K+0nQSCmPlnzZM9MJHxSh9QFQrb rD0/IsquA+T/UZNqDnJWMXz2A9azUnvPulVM0+o+MSe4M/QfJ42FJPNhOo8TQ2UvQWuI55c5O2 VJCGWABAGP0NrA83h8nsq/fiJbPbACbgZQbCMV8dwbrDkw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1653068807; bh=rCwSqa/yf3Uw7zI/gyH7sSfF31nVEsqKYd87IrRuuHE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Content-Type: References:In-Reply-To:Date:To:From:Subject:Message-ID:DKIM-Signature: DKIM-Signature; b=dyrXy2WtSqTdCJUo34YgJuS5h8uc/rCroKR9NQLZ67zcH0C9q8bdhPA4oUyMnXiwDfHMJNBI8F nymxpl70FH017L8/hLP3S9uoC1zwqpdgGVNxVm4z3jf1jYDTzjGcluVazrnorI34kds6e0sIgp HJQLn0WiVXBwa+VFlV6ArlYeQBFEfHgbdR1vMgUge8BTfQhzOkyqJMZ02ZeSBLsUHUokAfml+p 8RpuchaYUUkdmENPDFdHUZkShi/kGVXE903Vr30+kwU6iGgnKAlm0dAeMrU+ptOKHJZFqhnr4W 9EpDWEradp2T6RGEPe2BvgqLqMTqy5lNvvzDuKKTx5AsGQ==; 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: Mime-Version:Content-Type:References:In-Reply-To:Date:To:From:Subject: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=IQk8E6eYVPemdm59tmk+US9dfU53S6U8+eOQ+eYvCBU=; b=HKA/ofavAHwxS6M+cwlHz9f8x8 NJeqdGqQ+hZXjATTIjBDdVInyoZ4pLagvD5i7GshHT3x7Cx/irN9Cc/5vjVzxl++zxWYnNliaRS9v IR5WZYLZW/F/wH8Xxl2nqlx41RewmkoCDD11XwS5KritCpJwQGcUkqvSrBVA3cWSjBHmo6gwlnqWo B+EuVJPvcG6OFqLVHwwjB+DKdHyArwiuv8yAQZrpd2Paa+ZFInf1C7tepcXQT8tDr4JdLTalNXT7B jpY9qzIsJRolaH0MVPbqQ4ologdburPeq60qcuVljw3w4r4+ThOy6d149d6HdP1pU+d6uZrMbkx+o SxnVoDQg==; Received: from authenticated user by zero.zsh.org with local id 1ns6i7-0009Bj-8D; Fri, 20 May 2022 17:46:47 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:34854) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1ns6hv-0008uA-O0; Fri, 20 May 2022 17:46:36 +0000 Received: from [212.54.57.106] (helo=csmtp2.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ns6hv-0007wI-Ih for zsh-workers@zsh.org; Fri, 20 May 2022 19:46:35 +0200 Received: from pws-Zeus ([82.1.229.179]) by cmsmtp with ESMTPA id s6hvn5Xin7QLys6hvnXgxW; Fri, 20 May 2022 19:46:35 +0200 X-SourceIP: 82.1.229.179 X-Authenticated-Sender: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.4 cv=Ft4WQknq c=1 sm=1 tr=0 ts=6287d3fb cx=a_exe a=W4rGJ7PGCSRRUvufKHO8Dg==:117 a=W4rGJ7PGCSRRUvufKHO8Dg==:17 a=IkcTkHD0fZMA:10 a=oZkIemNP1mAA:10 a=aX8C2UlhgewN_GHu6oQA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1653068795; bh=IQk8E6eYVPemdm59tmk+US9dfU53S6U8+eOQ+eYvCBU=; h=Subject:From:To:Date:In-Reply-To:References; b=iLVaNFMlRl7JDmOUttf/1jRrNbDry/YXZJ46km+pKLXjqBJ3gTR5dIkpGMgRDSK8I Eqlf4vRJtAelW9y+VFHYaSTCtEDKPdcTQ5ctBs0eL7KaeoYkO6fKcpOxCcjgOOJtKa daOHI843K9P33V/Po6FO1WRmShe/m9YLEj9TDav8rFl4wJTPeBtGdDU0mh2wroixBU Pz4oTgJE6EKkMeiuEy0AhdHw2dMPXkE+A0bxwgxjQbvyf/wPpkCeV3xYYC4BMXqUW7 67fbigwo+cYDRqwughbAl04jx35p4Hvx0VL86bH/YHDRyCtL5rbPSonM2Nj2DuW6dS TmZd3Ad32rGzg== Message-ID: Subject: Re: Bug in function in function From: Peter Stephenson To: zsh-workers@zsh.org Date: Fri, 20 May 2022 18:46:35 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfD2aVKs6b1znFV7b6eFIFol0exweKylGTnGJFnv1j5jIfDLMafCNT0E2SF6uBdaX2oWIfI34XMofSQj5Zs2LTqDZ1ziCeOCepDWeDxTm0b8AKq5JUAtr +4ks/TYGs1TUQ8trk7irNVk5uyn9HV0qUpToXFGf7UXBS6sid/hG2kygj20lQ/mTvAr5yk04D9f1yQ== X-Seq: 50270 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 Fri, 2022-05-20 at 18:25 +0100, Klaus Ethgen wrote: > Am Fr den 20. Mai 2022 um 18:16 schrieb Mikael Magnusson: > > On 5/20/22, Klaus Ethgen wrote: > > > I have an alias `alias ls="LC_COLLATE=POSIX ls $_ls_opts"` before this > > > line but that should not interfere the function definition. > > > > In fact it should, and it does. Change your function definition(s) to > > the form "function ls". > > Putting a `function` in front of `ls()` work. > > However, I was thinking, `function` (in that context) is deprecated. No, it's valid syntax and will remain so --- just avoid using both function in front AND () afterwards. This is indeed the recommended fix for this case. The point, in case it isn't already obvious, is that alias expands everything in command position before it's even been parsed --- so your "ls" has turned into something else on input before the shell has even swallowed the (). With the function keyword, the following word is no longer in command position. pws