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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4891 invoked from network); 9 Aug 2023 13:17:09 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Aug 2023 13:17:09 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1691587029; b=LvaDE7ijuscFy/WjOfawzHyhWZWxzWxc/mm0hdpOwONpu27MqMNYrDatp+b9GS+yr5lJY65O/6 37adz7gvaKO9gK5KAqu9Ud0dahawLq5t4JPXmIsQXplRq8PTxgUnSl0GldOXFrw8UNG8QmQJ9z cIMzkEijmCJVoLZT7CnC/hQQPMamTwhr8uamPjyMwX3hjNws9Is2nemfbCM3CpYkEM1T7YM6Fw wcnfAdNsaZnomrGn8pEht54G7L4AU65qdhfwvuPegZ05osPM7sX6lWTiHi6QJd7hZ6oOhIoqq+ YcmdH+cZXzQXdko4riGd17d9w+Fw2pFnAzxmBNOYv1PBng==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1691587029; bh=T8YCuJy5TZ1Qwx065jG4GPiz5eDjXmTgXj2WIAqqjt4=; 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:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=fLmjqvxaiYtPUXWvqGr2SEDxBZjTi5suXN32HfO+q1QlIFc1aJ1Pz1ZjP7w/LSVRRsOT821/Ev kVpPN0C/DDttstz7KzJkBsqIobP20aa0Skf6ByxBIi58yLs3J6OF2z7reC2ZYAYLSLsJf+R9Vo bsfpTOO6PXYcp9ya9SnB/VityZ5B+6D9cL+W5pBRawvYlFH66mhoPc4c77HzFYslrHLhMJHSWQ pIwxH5WHfGQoMdahMLuGLBo8waCnObo36fbUFoCdHWCp6yiW1V8Y0rGHT9g0LQfGONvGyBObwj TSYdAj3zRzJkWslx21R7y4kljq1K6kpE+gvK96diu4xAdw==; 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:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=GaFaBIUy/lyUvA0z4daz6OnXE2DuZMgT0H21O9IrQaU=; b=r95DMlI+x5v5Mt9dMeoGAZdPkq HucrNzYmclgtsHt4IgMMBCVe2xOzIQ3iaBhjLYMFp6gByNsRfRL6Goa34ob2chLQh5v9fO/O0U9dj kH5OuIyzsIl45NvT6GJ8isrq0khC+xQ1Pw5+GDb+Z2PIatB/a4s0IorHTwmyms+GiLvenG6Cv3MrY big7WtTCX9p8CeG0733joeMCsfQPJDuSUnxdT5W38Z2H8QqNEjK5pFr3ZH7Cz50fEcY6ytmjsJO8v CDoSNxxs3L4oAkNKPE/9ivBjExz+5f7kvE4S5V8a4d40rNOiYcn4fPm1DPetglw9Qs9NhJ6mbLUaG 21dmxmRA==; Received: by zero.zsh.org with local id 1qTj3l-000Oon-MU; Wed, 09 Aug 2023 13:17:09 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f48.google.com ([209.85.167.48]:61879) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qTj3X-000OUn-Se; Wed, 09 Aug 2023 13:16:56 +0000 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-4fe389d6f19so10742254e87.3 for ; Wed, 09 Aug 2023 06:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691587015; x=1692191815; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GaFaBIUy/lyUvA0z4daz6OnXE2DuZMgT0H21O9IrQaU=; b=mi7gqHB9TK8hCsDBR1jj9Mck9ym0Wdt7HiArJyZADI4CY2Z0p8kLAy6TZBBhNi3GS9 2WuiKZCWNWYD1ajin9PqAmb2tfrxrP/5S6jzz9/f3f8NzCD8QUsDtWLGBe79wrjkd7qW huhrSqDsc70KEIx9ANPYHHjHIR8NiL+yKEOQJrnWO7wj20j4jKB/W9cr6XPsuNyu+z8s cEOFGEBQikGt2ZaZJlCexEl+EGo7irLiaJRn17erOGKoo/u/and60oXybIJ2TG5Jskr9 7j8xmKggXiARWP0fUiQcI3m3Xa3aS5TEzqi84/qGQVx5bMg3tuB4xFMlbEzwRsFXI37y GKjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691587015; x=1692191815; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GaFaBIUy/lyUvA0z4daz6OnXE2DuZMgT0H21O9IrQaU=; b=jzDbELzA1ZslKc4QgZssdr658l4z4/tz7r+8B4TOBes9Jsh1mjX8qJ511jm87YyAQA 5Uv3f9fP0a+bBxOAJFsJxC6OtINzUVG1VjhOnvF2FQ2KgYhN3/prVRcH4AjJFPdam7i5 oh8mXsj4aGrvhkb0jXOrAfaCAMNtdwOYz+iBdwWFt2hChtfIU7xlSgZ0XGRAu7Dp/BpF xUrZzwo/cfylKRp/JvE1+/9O5RAHIomhsHw3D+kF95zfzEQEPrld4ALwIaLde3Ycwj9u YCSyp/+7wA3XkmFO+OMp2F92iEe+2nUGEt2UcRZdfSsx6CaRsAIKrK6ajlFNVVu82q2x 5ayw== X-Gm-Message-State: AOJu0Yyw+aGB1/H0kzTXGW13uwG1KKHFI2yzJ0hwLWs+PfgB/LS6yOfN xn/P2xPUf5bDFS6DRL7XwwlAJURtMaej/u/f2V48gQM7 X-Google-Smtp-Source: AGHT+IFR93bDc55PDWwHazgZWifAb15ozBYPzLBtAzRSWymsBoi4KvgZNja2F1HQL6GW7vuqzZ1jdOnZhrShNJK/H74= X-Received: by 2002:a2e:9c48:0:b0:2b6:e292:85ab with SMTP id t8-20020a2e9c48000000b002b6e29285abmr1625834ljj.25.1691587014836; Wed, 09 Aug 2023 06:16:54 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:907:d22:b0:977:e915:2f69 with HTTP; Wed, 9 Aug 2023 06:16:54 -0700 (PDT) In-Reply-To: <7105a328-a753-b5ce-0111-92e1b3fa781b@crushedhat.com> References: <3a8e90b4-def1-bada-c118-68ddc1245972@crushedhat.com> <7105a328-a753-b5ce-0111-92e1b3fa781b@crushedhat.com> From: Mikael Magnusson Date: Wed, 9 Aug 2023 15:16:54 +0200 Message-ID: Subject: Re: [PATCH] Add option like tcsh's dextract To: Tim Eliseo Cc: Bart Schaefer , zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52036 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 8/9/23, Tim Eliseo wrote: > On 2023-08-05 16:48:07, Bart Schaefer wrote: >> On Fri, Aug 4, 2023 at 9:47=E2=80=AFAM 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 =E2=80=9Cit seems that the same thing can be accompl= ished > with setopt auto_pushd and using cd instead of pushd=E2=80=9D. 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: > > =E2=80=A2 cd doesn=E2=80=99t print the directory stack afterwards > > =E2=80=A2 cd behaves differently than pushd with no arguments (go to home > instead of swap the top two) > > =E2=80=A2 With auto_pushd set, there is no longer a command to change dir= ectory > 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 =E2=80=9Cpushd=E2= =80=9D instead > of =E2=80=9Cchdir=E2=80=9D in error messages. This would all have been good information to include in the original post, or as a followup to my initial mail which you never replied to, where I was clearly not aware of these differences: > in fact i > was not aware that the list would be rolled with pushd because i have > always been too lazy to type it instead of cd :). > I wrote this script as a first attempt to implement the behavior I > desired (which was to duplicate tcsh=E2=80=99s dextract option). I now re= gret > even posting it, as it seems to have caused more confusion. The mistake was including some details only in the comments of the script and not in the mail, I did overlook some comments in it. > BUT THERE=E2=80=99S 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=E2=80=99m not feeling particu= larly > 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=E2=80=99t > understand. What more do I need to do to move this process forward? Every time I've asked for more details you ignored me, which as I pointed out earlier is not a good approach. I thought I very clearly asked you in my first mail why just cd + autopushd was not enough, and then you wouldn't even reply to my second request to answer my question which surely put others off as well. To summarize, when you send a mail with a patch, explain the patch and why it's needed in the mail; if someone asks for clarifications or seems to misunderstand you, rather than assume that they can't read, assume that you were unclear, it is the safer assumption. --=20 Mikael Magnusson