Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Re: zsh completion for umount
- X-seq: zsh-workers 39796
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Re: zsh completion for umount
- Date: Mon, 31 Oct 2016 23:17:29 +0000
- Cc: Fourhundred Thecat <400thecat@xxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Q8+HOFaDLprsjSa Qq58ON7FhHY4=; b=LSlpQYIzwrVI9WxtusOWXjEw8ZpG++3pj/qNsUdl+d//BCx e7Jtl9lOpwYcWzDKopCZeKVXg+SPA2DX10MXHsNR248WvpRws/qSf2kaUbDRiJQh mClGEXb4Gf8Rb98emIiiWBRT7XmAOIqAsBi5AcCkkamaUKp4M4NXprHTq0ac=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Q8+HOFaDLprsjS aQq58ON7FhHY4=; b=Bq7dOXrGjcqBcsG+1QKHO4+PZs6H3tFDk5Tykn+euDeqYl 1MdI6AFh3DA9LxRj6FTa9PiD5r4sTAnEOo/0oM0nPVUhlKk+Jl4tNb+mYnQK0oSb K5DbhKNJ1fNTasjJ+PiAoxfEz/jVVxENPvy7C6KaXC0CpaVNGB10V/oreTSwI=
- In-reply-to: <161031123252.ZM20846@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <5815DDAB.8070307__40712.3355348178$1477828401$gmane$org@gmx.ch> <20161030153537.GB12137@fujitsu.shahaf.local2> <58164C21.9090505@gmx.ch> <161031004732.ZM18486@torch.brasslantern.com> <161031080627.ZM20240@torch.brasslantern.com> <161031123252.ZM20846@torch.brasslantern.com>
Bart Schaefer wrote on Mon, Oct 31, 2016 at 12:32:52 -0700:
> On Oct 31, 8:06am, Bart Schaefer wrote:
> }
> } The remaining problem is that _canonical_paths_pwd screws up "cd -"
>
> Patch below attempts to fix that.
>
> diff --git a/Completion/Unix/Type/_canonical_paths b/Completion/Unix/Type/_canonical_paths
> index 6482602..4b6b0c0 100644
> --- a/Completion/Unix/Type/_canonical_paths
> +++ b/Completion/Unix/Type/_canonical_paths
> @@ -16,11 +16,13 @@
> _canonical_paths_pwd() {
> # Get the canonical directory name by changing to it.
> integer chaselinks
> + local oldpwd=$OLDPWD
> [[ -o chaselinks ]] && (( chaselinks = 1 ))
> - setopt localoptions nopushdignoredups chaselinks
> + setopt localoptions nopushdignoredups chaselinks noautopushd
> if builtin pushd -q -- $1 2>/dev/null; then
> REPLY=$PWD
> (( chaselinks )) || unsetopt chaselinks
> + [[ -n $oldpwd && -d $oldpwd ]] && builtin cd -q $oldpwd # For "cd -"
> builtin popd -q
Couldn't we avoid calling pushd/cd entirely? I.e., something along the
lines of
if [[ -o chaselinks ]]; then REPLY=$1:A; else REPLY=$1:P; fi
?
> else
> REPLY=$1
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author