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,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4539 invoked from network); 27 May 2022 03:50:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 May 2022 03:50:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653623450; b=kSQMDgLWr0EfHf2yV7F4v6k+Bsb8yyWfZpjb5NDA+x5rszwWtP3FKSvTciSxwrEmfuUwJTJjhk jTGhKivRsJx2ZQP7k6PuQRcoQ0uiogBiHwuZ9kI4RhZOWsOYViCbUxUSQgitZcalCMYQwyZC05 vkoTmU1or8QDVsumkg7DyGMihApeUJox0X1NU0M+LJdEvGYYyQXVsiVbJAsRqdEEOJsSGriIod 8QdaXtn27pkKRex5NjdqAKCCnhz2BDMo1CS+oe6t+Hzx3l9/0HxjZYYzkXcfLehLpow3zLa7o8 p+YhGO4T0R4EYSRqM1MqBQWmiin8jmjiMQkyxB1hiVFxdQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 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=1653623450; bh=45QDWzLjrTyn3PxFsuoTZxjs/lPVPMRbJuQZF+vBNRA=; 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=SE5ZFb32R8xZMlZKkvbnD3LVTCj7NTZ4zz2odAsCM/p4vSxblAx6AsovAGcuBmdfzdad6upbtJ lrZpDZqNObE3a51PBbArdAuf6rVO2BanDI6QHbTXZfIIbXM2LwG4uOVxMCknf4YipFjxtM2Kic VLulJXzEyLxlTDL7ZsS/5bc3m31/FlrL6seA2r5Q6f35fubNc9DRQLXOfg0VfdltXWQ9IV26D3 I32LfUwpN+7Op51LFeaEv9oyQbXHrZmuNRzhJv7zVWS58x7VY67qosbRK7VK9aSY8oLHuWPuzp RfdEyeevKy7doFlMRJwx+r2lSoZ8qKBEAMFY8XRsp7cIOA==; 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: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=MghlAODlSYcJYkFy9M5KEW0dS5cOIEYUDZ0kkn4nfUI=; b=Q5zFoLz53Hjc8NU5mVTkyMRBr5 IVxTxM7yzZoZuX1xkSWSXJtmkp3tcM+kkKEZOmVYAiWlWQteYJaJzDUPeaGDta0bvXnuySgX33dvA x48tojvHFHsLFp5a9UVnWuXxYuBuun5TB1Np6xxz/QPFe6nrUfqZGXIEy85E15Yy0YSyCrxKliveY 5My2mwVAio6ITynoPQDYeXXqohQ55wHgPA7cllEunOL8Q9tiDe29c3BHrwAFE5zbhrNA4RtY41O08 GYEfM/VKNFlpdkUyJyRQrEyUNfRKgnllZJuuoZScjB6YKdHaLHG0PYevB93k0SJ8jGe+8D0bxlFvM yqjob9vw==; Received: from authenticated user by zero.zsh.org with local id 1nuQzy-0002sm-BW; Fri, 27 May 2022 03:50:50 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f48.google.com ([209.85.208.48]:36539) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nuQyu-00024l-TX; Fri, 27 May 2022 03:49:45 +0000 Received: by mail-ed1-f48.google.com with SMTP id fd25so3962674edb.3 for ; Thu, 26 May 2022 20:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MghlAODlSYcJYkFy9M5KEW0dS5cOIEYUDZ0kkn4nfUI=; b=DspGSyMCKMLgvpl3Sf3fY3vvrNJa/VDLKP7Sc2EeLs1nPKAAipHrOclmfCR7MDmvYk xWV3Bz7+9wPDPgfEJhRdSkbiU7ki2JAOnTzIdFvs6jH2OjH7t2dyPZW/f2mmZR/Q0U/d jPIXuprv8/yzgAHWKHo9xXHfVkC/RswUigMjMe7XoKn55o6YeP1YH6kUn7ue0GKHcB6O h62V6DMOW05y9so974cc4jdvHMOK6FWK0dcsDnmRg9RFvzr1TiMLOl6XHLtwDRXgED1o x6Ax+wsCpRN6iMusTR3AseNYY5xMA/HC2WdcNbymIDBuCNpTIDyN5FyAqIIvd6fSSEat ey9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MghlAODlSYcJYkFy9M5KEW0dS5cOIEYUDZ0kkn4nfUI=; b=4mrrE9UJngXbwTm6KNGDwuxio+hmKxwkYDkR0/ufzq5gDNjllirp1EK8PqNbK4fFKk Y1jU4M73oujGWhNX88zq97BfsLtEDX88MpTukmprMxwoWS6O79e2AAGCsPVeGSOZOxJx bkZtjqZVFrXiD3GJj8k+gq1OSCgpqToinuPs6uVeXMDFHKzChx64zoll3eOMvt0j9QU9 fm+IHaQLNv0DIweR4wWGv2Jli5rZbXiYvFpLmbaq+vC01MH/kHA8IEPDU4BP8GaRTBk4 WzIdUiu6G2yeagwqhUKuHDc+c89D9q6wzRFjBY/7Byr0mQQXThyorSMfoyUNE1wp2MXP xykg== X-Gm-Message-State: AOAM531FNE5vsinavEkqVDKwRYRcya7+mx3R5KFAYodaJuaLUOhOopkE VpMcEJueTSEnT/AtT8IDaeknGFT4RC6D9RbLkjdySQ== X-Google-Smtp-Source: ABdhPJwOe3AamLmJ2eWXgBowuJDE1FDxgW4f9+SP1F1/AsLeyhydESEwHz8spneHWBd9huO47TTDdkxt5xRIi/Qca7c= X-Received: by 2002:a05:6402:cb9:b0:42b:d201:c65f with SMTP id cn25-20020a0564020cb900b0042bd201c65fmr8899884edb.416.1653623384408; Thu, 26 May 2022 20:49:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 26 May 2022 20:49:33 -0700 Message-ID: Subject: Re: Function names prefixed with "%" To: Zach Riggle Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27810 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: On Thu, May 26, 2022 at 6:15 PM Zach Riggle wrote: > > It seems that it's completely valid to declare a function with a leading percent, but it's not able to be called due to be interpreted as job control. The very first entry in Etc/BUGS says: The pattern %?* matches names beginning with %? instead of names with at least two characters beginning with %. This is a hack to allow %?foo job substitution without quoting. This behaviour is incompatible with sh and ksh and may be removed in the future. You've noticed a corollary that command names can't be matched for the same reason. > Is there any way around this behavior? I've found that this can be worked around with aliases... You can check in an accept-line wrapper widget or in a zle-line-finish hook for whether there actually is a job matching the pattern and insert the necessary leading backslash if there is not. Or if you never use that job lookup syntax, you can just always edit every word that begins with % to instead use \% via one of those functions.