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.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8587 invoked from network); 8 Aug 2023 22:13:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Aug 2023 22:13:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1691532828; b=WHQMYaZR1lufQMoDDjuySkuU247nTUky791qdNJwHY4/oJUR1PbLU4vvoZfQtfCdEN49CqFNuR 1+uUOOIinvUm2sPwSFWSGsjLNsaueCuwnBZZbQUv2yc4loooGNq1gxBoXM86+c2MwdjCwSw/sR Ab+SVmWBWkyHnllAM73VwLkEBUuJDchRu65Ucgr/FwMKvGqYT1xMk6nY2AEjINheCboEY9gY9r PoJYcEU5hvBeegPWC+FWxGbZ0+41MLnXo6Y/Oeej3GrQkVwUd9NRZQYTafDKtBmJCling3z3oZ Lxnyaeu44w66FqA7bxMXNoAyx70tUbMHKReKfpK2BJORdQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (racky2.crushedhat.com) smtp.remote-ip=50.209.93.117; dkim=pass header.d=crushedhat.com header.s=default2k header.a=rsa-sha256; dmarc=pass header.from=crushedhat.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1691532828; bh=eXbIlGgLOtu5zRpn3H85aOy+Z5fddPY1RjsiIA1mdEA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Cc: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=NeTQzzrNHWcSCTl+E3donHHZkCcUoVU1lvLiGGHefTZ7L84qhR2bUJETrubn4o4cnZHaBHJdXj iAyKgR0E+cC11FZitUiCZvba0Fh3DzorKKOuFsJOHjalKkhPsRU2WIWmxITb7i2gyNH0w+TiJ9 GCJm9QCzgiAZc8gHG+R0AOjg82Bq5uLO4LCf5UlTo/wZfxGf1WQ7Y+eEVONkrPf+8xa7jDIGEd PiisnAkjxOCuVtl5wGi6CFMt6ptSk5remmJnETh7Gw3EsF8n9BrA29kkawxDOh6osNN+VBRxeh gzhl3r7xeX512JrDjy41Dk7xT+dJpOhhT2+xD4ulOEiocQ==; 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:In-Reply-To:From:Cc:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=K+991jqiXiM1H+/Ex/gAi9Isl6JiHth3prrHnZGx9Vo=; b=Esdzf3lphUnKuEa+ENnRzklcgi mo2EwRWEeTHOmhKijf2knP1BhGDiUCav8DhQbLPF9JTDn/+oabUWIqwIaf8bEjdwlf1vny0ShQgCb 0O/IFGSOxLK1qhoaDvRgz6FcbWqOMNURCqkjX3yoTA9JfvSaDds7wlH3USM6Ns3fS+n7rKjo5DQhT xS9BIEXad5DZObJhHvJ+T1zh4WkMdg43qOq16mqQFcAAzR1rFPUmwqE0tz3Eag+tWGOyOYtXkTvHF +/mIpgzIRhKsVEgQ19+x4iZ9xrGhXu9OsQKOxo0KosZr/du0zVYk1OpkRc/wI4hdHLvUmZHoRqtLZ z6VmFcjw==; Received: by zero.zsh.org with local id 1qTUxW-000PVH-9M; Tue, 08 Aug 2023 22:13:46 +0000 Authentication-Results: zsh.org; iprev=pass (racky2.crushedhat.com) smtp.remote-ip=50.209.93.117; dkim=pass header.d=crushedhat.com header.s=default2k header.a=rsa-sha256; dmarc=pass header.from=crushedhat.com; arc=none Received: from racky2.crushedhat.com ([50.209.93.117]:35412) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qTUww-000PBC-H0; Tue, 08 Aug 2023 22:13:12 +0000 DKIM-Filter: OpenDKIM Filter v2.11.0 racky2.crushedhat.com CB1F36F0DFB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crushedhat.com; s=default2k; t=1691532787; bh=K+991jqiXiM1H+/Ex/gAi9Isl6JiHth3prrHnZGx9Vo=; h=Message-ID:Date:MIME-Version:Subject:To:References:Cc:From: In-Reply-To:From; b=FF/CaWnjGGEjNPPBKf7qUfeN5qpxc2KMCx+a3w5omVu4K/8kM9X/rza4T+OIego8Z 08wXa4JLYTBnGoaWbokCLb2iozviCl1vdGfFLr8USPlWHOCob8ULPe1H5lEzglcqlG oDs9KRIHHmy1BB3VtVn6yeQkeJJyCvcDxK40OaA2IML+vZs2rvdxDQZ9k5n3dCt/yy 88WjpoiiX/AMRAyDVXSq4Pgld8CSpb1t238CeS9cAWrWai2UjwE1ne7ULHmqq/hgYk uN7DOYhoczkwfDy4cg5qchTXJqtRlQme1TCltl0i3idAXXvHBIzvuJREnVt9y//Mhp 3BuxDof733xiA== Received: from [IPV6:2603:3006:10c3:e100:e23f:49ff:feeb:21a3] (sheba-ipv6.crushedhat.com [IPv6:2603:3006:10c3:e100:e23f:49ff:feeb:21a3]) by racky2.crushedhat.com (Postfix) with ESMTPSA id CB1F36F0DFB; Tue, 8 Aug 2023 15:13:07 -0700 (PDT) Message-ID: <7105a328-a753-b5ce-0111-92e1b3fa781b@crushedhat.com> Date: Tue, 8 Aug 2023 15:13:07 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] Add option like tcsh's dextract Content-Language: en-US To: Bart Schaefer References: <3a8e90b4-def1-bada-c118-68ddc1245972@crushedhat.com> Cc: zsh-workers@zsh.org From: Tim Eliseo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Seq: 52032 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 2023-08-05 16:48:07, Bart Schaefer wrote: > On Fri, Aug 4, 2023 at 9:47 AM Tim Eliseo wrote: >> As my sample workaround script illustrates [...] >> achieving the original tcsh behavior >> without a builtin option is non-trivial. > # The chdir/cd builtin, with one argument in [+|-]n form and with > # the auto_pushd option set, has the desired stack extract behavior, > > I believe Mikael's assertion is that the extra nontrivial checks in > your sample workaround are not needed? Where are you observing (or > where is Mikael failing to observe) a difference? > What Mikael said was “it seems that the same thing can be accomplished with setopt auto_pushd and using cd instead of pushd”. Yes, stack extract (as opposed to roll) behavior will happen using cd with a +/- argument and with auto_pushd set, a fact I exploit in my workaround script, but that does not make cd with auto_pushd set a suitable alternative to pushd if one desires stack extract behavior because: • cd doesn’t print the directory stack afterwards • cd behaves differently than pushd with no arguments (go to home instead of swap the top two) • With auto_pushd set, there is no longer a command to change directory without pushing the current (i.e. replace the top stack directory) My script works around this and implements a pushd replacement with extraction, and also has to deal with the complexity of other conditions like command options, pushd_silent, and interactive/non-interactive mode. One thing not possible to do correctly is output “pushd” instead of “chdir” in error messages. I wrote this script as a first attempt to implement the behavior I desired (which was to duplicate tcsh’s dextract option). I now regret even posting it, as it seems to have caused more confusion. BUT THERE’S A BETTER WAY! The patch in 51958 implements this new option (pushd stack extraction instead of rolling) very cleanly, without introducing any backward compatibility issues, and includes updates to documentation and a test case. I spent significant time trying to get this right, and feel it is a valuable (albeit small) addition to the zsh codebase which will help some other users making the transition from tcsh. I have to say that, as a new contributor, I’m not feeling particularly welcomed. Do the zsh maintainers have a process for deciding to accept contributions? I tried to be polite and patient, and got criticized for it. I asked for a second look, and then got asked what *I* didn’t understand. What more do I need to do to move this process forward? Thanks for your consideration. Tim