Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Add option like tcsh's dextract



On 7/18/23, Tim Eliseo <tre-zsh@xxxxxxxxxxxxxx> wrote:
> Hi all!
>
> This is my first post to the group. I’d 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’s a worthy successor. One
> of the small things that kept me from jumping to bash (along with
> everyone else in the Linux world) is that it doesn’t have a proper
> 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’s 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’m still baffled
> why it wasn’t 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’ve done all the
> appropriate option handling, documentation, and unit test to make this
> painless. I didn’t write a ChangeLog entry since I wasn’t 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.

-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author