zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh list <zsh-workers@sunsite.dk>
Subject: Re: bug in accept-exact-dirs style
Date: Thu, 29 Jan 2009 08:20:25 -0800	[thread overview]
Message-ID: <090129082025.ZM15909@torch.brasslantern.com> (raw)
In-Reply-To: <18815.40644.128711.97121@gargle.gargle.HOWL>

On Jan 27,  6:54pm, Greg Klanderman wrote:
}
} [~] greg@lwm| zsh -f
} lwm% mkdir foo
} lwm% touch foo/bar
} lwm% touch foo/baz
} lwm% autoload -U compinit
} lwm% compinit
} lwm% zstyle ':completion:*' accept-exact-dirs yes
} 
} Now try completing each of the following:
} 
} ls foo/                # OK
} ls ~/foo/              # doesn't work - no completions
} ls /home/greg/foo/     # OK
} ls $HOME/foo/          # doesn't work - no completions

This isn't directly related to accept-exact-dirs ... a prefix that
needs expansion is removed by _path_files in the section between the
comments

# Now let's have a closer look at the string to complete.

  and

# Now we generate the matches. First we loop over all prefix paths given
# with the `-W' option.

The result after removing the prefix eventually ends up in $tmp1, so
when that is a string that will still pass the -d test in this loop:

    while true; do
      if [[ -d $donepath$tmp1 ]]; then
	donepath=$donepath$tmp1/
	pre=$tpre
	break
      elif [[ $tmp1 = (#b)(*)/([^/]#) ]]; then
	tmp1=$match[1]
	tpre=$match[2]/$tpre
      else
	break
      fi
    done

Then the code is fooled into thinking that the suffix is part of the
prefix, and on line 585 the PREFIX string is rebuilt in the wrong order,
becoming "tmp/~/" instead of "~/tmp/".

At that point I get lost, and I've already spent more time than I should
have looking at it.  PWS?  Anyone?


  reply	other threads:[~2009-01-29 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27 23:54 Greg Klanderman
2009-01-29 16:20 ` Bart Schaefer [this message]
2009-01-29 17:51   ` Peter Stephenson

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=090129082025.ZM15909@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).