zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: _expand limitation
Date: Fri, 17 Mar 2000 17:32:02 +0000	[thread overview]
Message-ID: <38D26C12.83DAFEF3@u.genie.co.uk> (raw)

I just did vi *(w)<tab> and expected it to expand to the one writable
file in the directory. It didn't work though. The trouble is that
_expand tries to expand things by doing ${~exp}(N). This means that it
is in effect trying to expand *(w)(N) which isn't the same as *(wN). The
easiest solution I can think of is if _expand does setopt localoptions
nullglob though someone else may have a better idea. The patch adds
this.

Oliver

--- _expand.bak	Fri Mar 17 17:16:01 2000
+++ _expand	Fri Mar 17 17:17:48 2000
@@ -7,6 +7,8 @@
 # the expansions done produce no result or do not change the original
 # word from the line.
 
+setopt localoptions nullglob
+
 [[ _matcher_num -gt 1 ]] && return 1
 
 local exp word="$PREFIX$SUFFIX" sort expr expl subd suf=" "
@@ -42,7 +44,7 @@
 
 zstyle -s ":completion:${curcontext}:" glob expr &&
     [[ "${(e):-\$[$expr]}" -eq 1 ]] &&
-    exp=( ${~exp}(N) )
+    exp=( ${~exp} )
 
 # If we don't have any expansions or only one and that is the same
 # as the original string, we let other completers run.


             reply	other threads:[~2000-03-17 17:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-17 17:32 Oliver Kiddle [this message]
2000-03-23  8:29 ` Let's obey our own development guide :-) Andrej Borsenkow

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=38D26C12.83DAFEF3@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.auc.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).