From: Francisco Borges <f.borges@rug.nl>
To: Zsh User <zsh-users@sunsite.dk>
Subject: Re: [zsh] dirstack history: loving zsh, crashing zsh...
Date: Mon, 6 Mar 2006 19:26:15 +0100 [thread overview]
Message-ID: <20060306182615.GA9938@let.rug.nl> (raw)
In-Reply-To: <060306085136.ZM4149@torch.brasslantern.com>
» On Mon, Mar 06, 2006 at 08:51AM -0800, Bart Schaefer wrote:
> On Mar 6, 2:01pm, Francisco Borges wrote:
> }
> } it won't stop that accumulation of repeated directories at .zdirs
> } (essentially since "dirs" always include the CWD).
>
> If that's the only issue, then don't use "dirs" at all; instead use
> "print $dirstack" which *won't* include the current directory.
No, I want the CWD, but that may become a problem because
1. "dirs" includes the CWD even if it is in the $dirstack;
2. "dirstack=( $(< ~/.zdirs) )" bypasses pushd_ignore_dups;
3. some popular directories, triggered this "double entry" many times;
4. pushd_ignore_dups removes only the first double entry.
(perhaps there was no need to explain that...)
So the solution is, AFAIK, really ${(u)...}.
> One other thing that just occurred to me is that a single line of
> output is unreliable when a directory name may contains whitespace.
> You should use:
> print -l $dirstack > ~/.zdirs
> dirstack=( ${(uf)"$(< ~/.zdirs)"} )
Or "dirs -pl" then.
> } I assumed I could treat dirstack as any other array since, well,
> } the *manual* says dirstack is "a normal array".
>
> I think "normal array" just means it's not an "associative array".
Were you guys surprised a user decided to use typeset on something
described as a "normal" array?
(users are cunning evil creatures and you should know it!)
8-D
Thank you for the explanations!
Cheers!
--
Francisco
next prev parent reply other threads:[~2006-03-06 18:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 17:52 Francisco Borges
2006-03-02 18:07 ` William Scott
2006-03-05 9:19 ` Bart Schaefer
2006-03-06 13:01 ` [zsh] " Francisco Borges
2006-03-06 16:51 ` Bart Schaefer
2006-03-06 18:26 ` Francisco Borges [this message]
2006-03-07 3:54 ` [zsh] " Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060306182615.GA9938@let.rug.nl \
--to=f.borges@rug.nl \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).