zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@math.gatech.edu
Subject: Bug?  multicomp no longer works for paths starting with tilde (~)
Date: Wed, 19 Aug 1998 12:08:06 -0700	[thread overview]
Message-ID: <980819120806.ZM11746@candle.brasslantern.com> (raw)

The multicomp function seems to assume that
   newtop=${~origtop}
will expand to the user's home directory, but that doesn't happen.  Later,
   reply=(${~reply})
also doesn't expand the home directory, and hence finds no matches.

This seems to apply to both 3.0.5 and 3.1.4.  Am I just misunderstanding
what's supposed to be happening?  I reverted back to the baseline 3.1.4
version of multicomp, and it still won't complete anything starting with
a tilde.

The following seems to work better, but messes up if there are wildcards
following the tilde.  Suggestions?

Index: multicomp
===================================================================
*** multicomp	1998/08/19 18:00:16	1.2
--- multicomp	1998/08/19 19:04:22
***************
*** 3,9 ****
  # e.g. s/z/s -> src/zsh-2.4/src
  #
  # Usage: e.g.
! # compctl -D -f + -U -K multicomp
  #
  # 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.
--- 3,9 ----
  # e.g. s/z/s -> src/zsh-2.4/src
  #
  # Usage: e.g.
! # compctl -D -f + -U -Q -K multicomp
  #
  # 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.
***************
*** 32,38 ****
  if [[ "$pref" = \~* ]]; then
    # If the string started with ~, save the head and what it will become.
    origtop="${pref%%/*}"
!   newtop=${~origtop}
    # Save the expansion as the bit matched already
    sofar=($newtop)
    pref="${pref#$origtop}"
--- 32,38 ----
  if [[ "$pref" = \~* ]]; then
    # If the string started with ~, save the head and what it will become.
    origtop="${pref%%/*}"
!   eval newtop=${~origtop}
    # Save the expansion as the bit matched already
    sofar=($newtop)
    pref="${pref#$origtop}"

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


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-19 19:08 Bart Schaefer [this message]
1998-08-20  8:12 ` Peter Stephenson
1998-08-20 17:29 ` 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=980819120806.ZM11746@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).