Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Re: zsh completion for umount
- X-seq: zsh-workers 39792
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Re: zsh completion for umount
- Date: Mon, 31 Oct 2016 08:06:27 -0700
- Cc: Fourhundred Thecat <400thecat@xxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject:cc :mime-version; bh=pAYAPri9spui8BfQzoaDcfjh14C7ctNXrcVUzKzW260=; b=sPVobWelVu4X3ra9OFiAKGA/nwcLWrsxEuT43RxV1wX1FEl6KHQqCIcjvOfs/PRaok W86psl7HjTHnLJAWAwlbPNU4QNKeCDAJdRO5fkXuG7GYVVAQ+DbDQlaxjt15dpAJ9aeB Ljenlvy+99Pz7Ge0pKB84BYf3Aq8pMPXIc9DXs1KiP4ZT41tmfUYq+DT0vaLHgwchoXU Fykr1Qkfq2iFg1xdWH1EVdn5fOXHSpxBWHBAA3Ar7HRjC/+oKl8nCHS5p1/DMYtT7hHk ADGrG7W3ihP/M9EHUilurwY2jsA4adXKcTEGa9vUrN4Ol1Eug/H1F4Rexfe36tWOT0xW a2Ng==
- In-reply-to: <161031004732.ZM18486@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>
On Oct 31, 12:47am, Bart Schaefer wrote:
}
} "_canonical_paths_add_path $PREFIX" is called which, if prefix is not
} empty, tries calling zstat to see if it is a real file. Of course
} this fails because it's not a file, it's only a prefix of a filename
OK, this is a lot better:
diff --git a/Completion/Unix/Type/_canonical_paths b/Completion/Unix/Type/_canonical_paths
index 9bccc7f..dde41f3 100644
--- a/Completion/Unix/Type/_canonical_paths
+++ b/Completion/Unix/Type/_canonical_paths
@@ -69,7 +69,10 @@ _canonical_paths_add_paths () {
expref=${~origpref} 2>/dev/null
[[ $origpref == (|*/). ]] && rltrim=.
curpref=${${expref%$rltrim}:-./}
- if zstat $curpref >&/dev/null; then
+ if [[ $expref:h == (.|..) ]]; then
+ _canonical_paths_pwd $expref:h
+ canpref=$REPLY/$expref:t
+ elif zstat $curpref >&/dev/null; then
_canonical_paths_get_canonical_path $curpref
canpref=$REPLY
else
The remaining problem is that _canonical_paths_pwd screws up "cd -" and
friends by frobbing the directory stack with pushd/popd. I may go back
to that in another thread.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author