zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@math.gatech.edu
Subject: Another multicomp nit
Date: Thu, 20 Aug 1998 11:46:32 -0700	[thread overview]
Message-ID: <980820114632.ZM4043@candle.brasslantern.com> (raw)

This bit of code:

  if [[ -n "$pref" && -z $sofar[2] && -d "${sofar}$head" ]]; then
    # Exactly matched directory: don't try to glob
    reply=("${sofar}$head")

Is obviously supposed to implement this behavior:

# Note that exactly matched directories are not expanded, e.g.
# s/zsh-2.4/s<TAB> will not expand to src/zsh-2.4old/src.

There seem to be an extremely limited number of cases where this applies.
For example,

zagzig% ls /u/s/l/z/zsh-3.1.4/s<TAB>

produces

zagzig% ls /usr/src/local/zsh/zsh-3.1.4-build/Src                     
/usr/src/local/zsh/zsh-3.1.4-build/Src
/usr/src/local/zsh/zsh-3.1.4-build/stamp-h.in
/usr/src/local/zsh/zsh-3.1.4-orig/Src
/usr/src/local/zsh/zsh-3.1.4-orig/StartupFiles
/usr/src/local/zsh/zsh-3.1.4-orig/stamp-h.in
/usr/src/local/zsh/zsh-3.1.4/Src
/usr/src/local/zsh/zsh-3.1.4/StartupFiles

Clearly, it expanded zsh-3.1.4, even though that's an exactly matched
directory.  The reason it doesn't work seems to be that, one level up,
/usr/src/local/zip also matches /u/s/l/z/.  See:

zagzig% ls /u/s/l/zsh/zsh-3.1.4/s<TAB>

produces

zagzig% ls /usr/src/local/zsh/zsh-3.1.4/Src                           
/usr/src/local/zsh/zsh-3.1.4/Src
/usr/src/local/zsh/zsh-3.1.4/StartupFiles

Is the exact-match test even worthwhile?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


             reply	other threads:[~1998-08-20 19:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-20 18:46 Bart Schaefer [this message]
1998-08-21  8:02 ` 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=980820114632.ZM4043@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@math.gatech.edu \
    /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).