zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Vincent Lefevre <vincent@vinc17.org>
Cc: zsh-workers@sunsite.dk
Subject: Re: bad cd completion for ../ (with CHASE_DOTS unset)
Date: Wed, 1 Sep 2004 02:16:37 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0408302024500.5284@toltec.zanshin.com> (raw)
In-Reply-To: <20040830130320.GB19488@greux.loria.fr>

I'm having a serious case of deja-vu over this ... I'm sure I explained 
this before, and not that long ago, but I can't find the message anywhere.

On Mon, 30 Aug 2004, Vincent Lefevre wrote:

> Here, CHASE_DOTS isn't set, and my /home/lefevre/Mail directory contains 
> [a] symbolic link [...] if I try to do a completion with "cd ../[TAB]", 
> zsh gives the completions corresponding to the subdirectories of 
> /users/spaces/lefevre/Mail instead of the subdirectories of 
> /home/lefevre/Mail, though CHASE_DOTS isn't set. I think this is a bug.

The trouble is that completion uses globbing to find the possible matching 
files, and globbing always behaves the way "cd" does with CHASE_LINKS set.

You might think that the fix is as easy as deleting "parent/.." substrings 
and replacing a leading "../" with "$PWD:h/", but the way the completion 
code is structured makes that a tricky proposition ... I don't think there 
is any variable whose value can be changed in _cd that remains visible 
down in _path_files when it starts decomposing the path at slashes and 
examining each directory ... and even if there is, doing so would probably 
generate some strange completions.

That means the only "fix" is putting a fairly ugly special-case into 
_path_files that applies only to _cd, without breaking every other path 
completion in the world.  Sven W. is incommunicado and no one else has 
been brave enough to plunge into the jungle with a machete.

(I've always thought CHASE_LINKS ought to be the one and only behavior.)

A possible workaround is to insert another function into your completer 
style, which acts as an expander to do the above-mentioned replacements on
the current word.  Thus you'd have this sort of behavior:

zsh% cd ~/Mail/arc
zsh% cd ../<TAB>
zsh% cd ~/Mail/

That is, you'd have to press TAB once to get the expansion before you can
start completing.

> Please Cc to me (the Mail-Followup-To should be set correctly).

Chortle.  Quite a, shall we say, discussion about M-F-T is in progress on 
one of the IETF lists the last couple of days.


  reply	other threads:[~2004-09-01  9:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-30 13:03 Vincent Lefevre
2004-09-01  9:16 ` Bart Schaefer [this message]
2004-09-01 12:01   ` Vincent Lefevre
2004-09-01 13:00   ` Vincent Lefevre
2004-09-01 15:01     ` 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=Pine.LNX.4.61.0408302024500.5284@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=vincent@vinc17.org \
    --cc=zsh-workers@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).