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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24243 invoked from network); 18 Jul 2023 15:17:31 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Jul 2023 15:17:31 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1689693451; b=nb5w1JH81d8nQaYp0kPTaBgygNBq94my6xIQrW4LGHIqq+idVREN+6CgZmtN2vxJZhSUMsNDdV SJ1CVjm1PfDQeNyCt4wpSsgS5wRb72bw2K7z3+gWXqqYUkGPqVYwcdhk/q4Dc+ctvI7fnBhdff dJspr2qRUN2pX56yIOb8TNkxhqAhlmT2bHMXRLss/QhUot56Gl+W6nTtIsEiBPe8v1KiwNs3K1 CBqt1H2uHSYSS8pgZ7UaI3g0tw7hj6QGnDolbkHzBgg1nKlvO1SPmTMW8NyVki7yWv3+bDhIpz dhZIWydB0jrCJBz7GEKnejwIUEEenwzsaTK+HngxqgJspw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; 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=1689693451; bh=JZ4nk3jyu1biIdGtWxgJzVNT5tFMFgDg3ojXW5PzbsA=; 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=dKDip/614McifWSGIysI4G93yIbzsVw+s5B/zDK9WhW5H4SxQ4V366ANMXpcXiUxky5jbO14V+ 97VvJCT2O0xAF1kKkZT/FL8fWnQkIDty+h3VzxxpctCaA7dL3SyasuXe+MgAd5/L+HorRBSroS 5F5NaxCK4ttCjnxjd2Ca8Vf7dFVK3NS8/0uq0cvb/N9PZ1QF4uDoWRR9aHTElZnBxCXqx8+1Xk 8/521NaFfIIy4RgxotS8591WBpnWhEEMHR45JlgxCgtkyPOt08uVNBcPH2jd736LSOa2r5k49r S6E+zLxT2bC4BFmrmQmMpYND0bPVLeYv7Brizq9gOtFC/Q==; 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=JZ4nk3jyu1biIdGtWxgJzVNT5tFMFgDg3ojXW5PzbsA=; b=PBirmUNBqcJfaS/OGD3tAwNxIB ok8aFHGtR2ub1AgeIG3NF6H/rbDTQhJjs4uapuw+ng8Bwm8DozNC+tyxW+0KkRHxuUJd8vfF3EoCW Ue3Lt/KgYsqQBtIv0T6mDuBcR7CN9rK/bcX6AxChp0YZgY+UyKwO0DEussJbJtiJa9RNuAUEZRS4R d/zXw3RdTu8KMHDc7cqA+0Dn5Mgdbez2XAjeVUUxrfIdlIVJWwcKork1epWdVaQvmbzmT26eF3RpH BUcVgZMhGXFQrlnPGneoZ5d5fo9LIs6WSy46HpxZxaA75vRjkf4T6tjk979cBNCF7wp/iwoS3v8ck a0T1/edw==; Received: by zero.zsh.org with local id 1qLmSA-0007am-NM; Tue, 18 Jul 2023 15:17:30 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f51.google.com ([209.85.208.51]:52732) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qLmRu-0007Gw-92; Tue, 18 Jul 2023 15:17:15 +0000 Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-51e566b1774so7751044a12.1 for ; Tue, 18 Jul 2023 08:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689693433; x=1692285433; 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=JZ4nk3jyu1biIdGtWxgJzVNT5tFMFgDg3ojXW5PzbsA=; b=ALmbAVE/RolItoKvv1bxYxpmk9nQyQPDpsweeSSrxUTzlfm28k5qz99v8oGjRvzQTJ VEvvfSilvBwmkxzykkk3gVhr12WzMV/Pli8pZ3qfQiqG8DkM2kPRTDIid5/JV4V0J7if /JiR1l1L5/Za6aLfl8/A5Aj4BckihnBI0wuO6pEnAAkzNRjqzQgy3o1rLD4Lv9o9QA2h gb4w2A3kuPioagdlINbJR3a1rEhgZ/nw9ZH7pfhzG5cD8nV6006896IX1+Fj2BWaGc/Q uom1FjzX0v7TzLoNhH5nZFuppcAGzonCoWSYUgGQGGlTc8FPpdzeRJbJDrWsBQjTX3ti ntcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689693433; x=1692285433; 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=JZ4nk3jyu1biIdGtWxgJzVNT5tFMFgDg3ojXW5PzbsA=; b=SLzjRh/Dmrs51ly6R8DjcpOvhBUjCQST1HzKlAakxKRdsRU6wmGZghW9uCRPSIdNyx heTuKQVYMn0F51DSZ2h7ifnncALPZjoFlmLZFHIhOjpHmLodwIICkaK9dyKdEP3tPYzT lWXVl6C6+L8nk4582JtO4pLtuGHFZuWPaAUuBpvZqJjGoIzZ3w9O/n3/EAXNmV8BKJYq cKQdF5bfIEXzEV124CrU4PaWDhlqOD6yd2IsvhoV9oYylZliThAm/bYEkCOZGeFwz6ln phqbEC/0ZZjTM89KwTyHXEcgrKvC0MZANU9z0iu/J+o+68SUZ7WeY/pMrTRcAfai+DR7 CsSg== X-Gm-Message-State: ABy/qLYt1abfvS0iBvauxdCLUacHyy1EfNn6yorlJg316Vo664mjvu7j xvUh1KMNF6S7WtLLe+EAy97b3DPRxOdiWD7O8Kjho2rg X-Google-Smtp-Source: APBJJlE8KBL04xW3QpTy4ggdfUIJr4HTtVDbTZg2I3FxBkXYWaOs4+1r6RSW0hvGyHdhrq9MAN9JCd6xqPQwYg+YDc0= X-Received: by 2002:a17:906:7498:b0:98e:933:28fe with SMTP id e24-20020a170906749800b0098e093328femr186577ejl.66.1689693433296; Tue, 18 Jul 2023 08:17:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:907:7e82:b0:977:e915:2f69 with HTTP; Tue, 18 Jul 2023 08:17:12 -0700 (PDT) In-Reply-To: <3a8e90b4-def1-bada-c118-68ddc1245972@crushedhat.com> References: <3a8e90b4-def1-bada-c118-68ddc1245972@crushedhat.com> From: Mikael Magnusson Date: Tue, 18 Jul 2023 17:17:12 +0200 Message-ID: Subject: Re: [PATCH] Add option like tcsh's dextract To: Tim Eliseo Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 51963 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 7/18/23, Tim Eliseo wrote: > Hi all! > > This is my first post to the group. I=E2=80=99d been using tcsh as an > interactive shell since way back when it was still cool, before zsh or > bash even existed. Zsh is the first shell that=E2=80=99s a worthy success= or. One > of the small things that kept me from jumping to bash (along with > everyone else in the Linux world) is that it doesn=E2=80=99t have a prope= r > implementation of asynchronous notify of job completion (-b), which zsh > does. Another thing that bugged me about bash was that there is no clean > way to emulate tcsh=E2=80=99s dextract option, which rearranges the pushd= stack > differently. I eventually discovered that zsh can do the basic function > through the cd/chdir builtin with the auto_pushd option set, but coding > a pushd replacement function was complicated to get right for all option > cases (see attached). Based on my own experiments and the hunk in the patch, it seems that the same thing can be accomplished with setopt auto_pushd and using cd instead of pushd? I'm not sure if it is documented that using cd instead of pushd with auto_pushd set will not roll the list; 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 :). > However, I found that adding this pushd mode to zsh natively was trivial > (simply testing for the new option in one place), and I=E2=80=99m still b= affled > why it wasn=E2=80=99t included a long time ago while someone was looking = for > ways to increase compatibility with other shells. The attached patch > (based on the current master branch) does just that, and I hope you see > fit to merge it into the codebase. I believe I=E2=80=99ve done all the > appropriate option handling, documentation, and unit test to make this > painless. I didn=E2=80=99t write a ChangeLog entry since I wasn=E2=80=99t= sure of the > appropriate format, or how to derive the number. (Is that an SVN > revision number?) The number is the sequence id assigned to your mail by the mailing list software (X-Seq: 51958) so it would have been quite difficult to know in advance. Conventionally the changelog entry is created by the committer of the patch. --=20 Mikael Magnusson