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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2555 invoked from network); 28 Jul 2023 21:38:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2023 21:38:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1690580318; b=kInKPs7bTeBmpWvaf6TDc4oUuODa0NJraEovg2Pk7rvWoiOGPexQHp+EAd2SKmNH2ynfPVOGiL KJOQ5GWaUu+lsCOl2EPWxAPPZrsUqdkXnW+H2IPGJWf1xUhtU24hphmQDLo6UH/OgOyed1/I1G aKdUMmS1JF4r0I4c00F0X6AktPUNa6XQmIEsGEIzKr/CKCFtczUTWLKjwpY9xPpolieXyck0Hf IBX2aulcFuOCITlR44hRupkPr6svJrXLjqLbOMkWM/aRH6Kxa1klUVS5X46usIRafsecvb4WHu KFn8rN/jviZEJ91MKVKCfl8T1NnDybKvmUZ8E/nh10eJ4g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f42.google.com) smtp.remote-ip=209.85.218.42; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 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=1690580318; bh=YdUquU1GChqOgZfPvcL0LbOMEoE5BhPrM2fTiDHI2U0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=ovAEHbMEd527DXXMiGT0942M4lvA/nrsi6uRVdaCC0e7BXR6LHmuBLVTMnLnHiAADuCyahA+iA QC7PGs2sZggQJqo9AvIzOYJ4P4T/MkJk+QtxYIq+bcK6gB4me8vzeHIeiHIBuSn4RH3PUgPJwS cLzuwEA/91bwG5ETVe9WKjH3SlGbITLQ+LrK+o7EoshbBNJLKQilk2TbBC2f/s/SSYd768E1vb yugN+Llq7KPIyxUBUNZwrwpwc7Qyg7Jh+wyMLckh79XmhABKFm559ovUYVWe37BCz5y8qynqIE Op6OF+Wmr85sfk51LYgKHyhxPCgfMCuQOO125mBvdt5puQ==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Q23Mde5desIue3WYVZOGuKo5QGdVn7Alt0mcrm4Ga6Q=; b=NOdwJZMdnC9bfGwbqJThYR8V5Z ECbzL6/juSqJlVE7CJGT8axQeHzvaIPNlJ38Mk3xagw3llr3jmjtRtvaNhEp3X6Ug/JwWlSUzmpwX SNfiAYqKX+zQgSTcSwX9/WWJtVTdQqwTrOsx48vrBRIKZbI9Xxw+qGCWoBB35ENZZeS895iubZtN0 sgTAhoFS4zt2AeRvgCvid3uHjQoK0Ou2eoaReDtc1YVfXtQDTd8F53kUgjQuL6FruNzPAHyyJYWuw j9nvdveQL4p9AcWbKTQ2tJkzgNUCsfAgSuMwSf/QlJu4ns8K3I1FKbQ+zJTSSKMIixHqUkJLf9pfD dCDOSdEA==; Received: by zero.zsh.org with local id 1qPVAT-0007MC-I0; Fri, 28 Jul 2023 21:38:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f42.google.com) smtp.remote-ip=209.85.218.42; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f42.google.com ([209.85.218.42]:49548) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qPV9u-00071D-FZ; Fri, 28 Jul 2023 21:38:03 +0000 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-99bd1d0cf2fso350825266b.3 for ; Fri, 28 Jul 2023 14:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20221208.gappssmtp.com; s=20221208; t=1690580281; x=1691185081; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Q23Mde5desIue3WYVZOGuKo5QGdVn7Alt0mcrm4Ga6Q=; b=xGGT/zwistK2pmJ/7H3jgqcVKu6BGG1dD/L/RMGYeXNcZOhjVr5Tg3Vd21QYg/PbDK lp7fjlkh5VWmEO1y3E3hVI+kC58jxkrk8CaXlNfv8DMuNQn4Jzc39U2M1VJg0SPgbk4k +t+oy9xJIiAHFUechgpX4th5STV8NYdOpL9V3F6nG4TNI2Ypje8eVgbI7IbqxqJNCNZw 96anlgVtNNdSr2OSAm8b8CzXEQyizyAyh9OIhxLTs8bPKD/AMN918Xxaf6WyCoARj1xF AWar7Yf2mW71RqgRS4sDOP2UNfLO2i8nAw80rk2viewlpZ9WVLfQGxyOL6YsDoZq376W +1Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690580281; x=1691185081; h=content-transfer-encoding:cc: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=Q23Mde5desIue3WYVZOGuKo5QGdVn7Alt0mcrm4Ga6Q=; b=I7W40KApFX2ESAaZVmu5hDiKCHw7QxowLRekq6owu0e5DjTYpB+guEoXPMQlwm1lxA wnTkMyyR0sRCTedH+t3TRWsn9oC7l0ERnr2fUCizLeKz8nkq3txyHMnqEgP1Kxr3WwpG 9OLqkOhtSRwG13GMAtyzVX3QXkqIwkmsr9x+LPFxiA1wLty2Z7cgBq69tBH0aC0bzlaz IDr/ZDoTI2s+J43oKrSm37RXVXuojz40SIWq+uSYHU2IzsUmVRdVwPKwkClVHY7qVoTW 6ExMk77L2QPpv3aBIoA4O/DObgDiHLBMGEmPDb5kfJ3qwi1H24RB4cB63er0H7vT1O0d EOhA== X-Gm-Message-State: ABy/qLYuyC6SLGLzZ2ShjqAjuz93r3Zv95qvdHaJw9SGNWjj2KVGblV1 yTCRmwoatkUHIq1MImdnQCzFf0i3G5mRk33ZGf9ZOA== X-Google-Smtp-Source: APBJJlED+iZXmMUahHKy125CRwONAIQw/2sDQ1Ot9fiVfNGM4JgJ0yek7vo/wHk5ttWMHrsfVubrN4q+LsjmLaKO9hg= X-Received: by 2002:a17:906:7a57:b0:988:6491:98e1 with SMTP id i23-20020a1709067a5700b00988649198e1mr449265ejo.42.1690580281563; Fri, 28 Jul 2023 14:38:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 28 Jul 2023 14:37:50 -0700 Message-ID: Subject: Re: Can this snippet be further improved? To: Sebastian Gniazdowski Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52001 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, Jul 28, 2023 at 3:07=E2=80=AFAM Sebastian Gniazdowski wrote: > > For example, would be :P instead of :A better? > > On Fri, 28 Jul 2023 at 09:53, Sebastian Gniazdowski > wrote: > > > > 0=3D${${ZERO:-${(%):-%x}}:A} What is $ZERO ? (I'm not very familiar with the "zsh plugin standard" here= .) Is there a reason not to use ${funcstack[1]} instead of ${(%):-%x} ? I presume you're assigning 0=3D at top level of the plugin, otherwise %x is going to be the file where the function is defined rather than the file where the function is being executed and further you'd mess up FUNCTIONARGZERO et al. I suppose %x doesn't require zsh/parameter, is that really an issue? As to :A vs. :P, it almost seems like :a:P would be preferable to either of those ... :A is described as ":a followed by realpath() except where there is no realpath(3)" whereas :P is "LIKE realpath()" but doesn't actually require realpath(3).