zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: RE: all completions
Date: Tue, 10 Oct 2000 10:11:41 +0200 (MET DST)	[thread overview]
Message-ID: <200010100811.KAA22890@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Tue, 10 Oct 2000 12:03:54 +0400


Andrej Borsenkow wrote:

> > The patch also contains a completer, _all_matches,
> 
> Pardon me, it does not :-) This is the problem with newly added files - you
> have first to 'cvs add' them; then you can generate patch with 'cvs diff -N'.
> Else 'cvs diff -N' ingnores newly born files.

Since this is a test-patch which isn't committed, this hasn't anything 
to do with cvs. It's a matter of my little brain forgatting to create
an empty file in the directory I'm diffing against. Sigh.

Bye
 Sven

--- ../oz/Completion/Core/_all_matches	Tue Oct 10 10:07:05 2000
+++ Completion/Core/_all_matches	Mon Oct  9 21:15:04 2000
@@ -0,0 +1,35 @@
+#autoload
+
+_all_matches() {
+  local old
+
+  zstyle -s ":completion:${curcontext}:" old-matches old
+
+  if [[ "$old" = (only|true|yes|1|on) ]]; then
+
+    if [[ -n "$compstate[old_list]" ]]; then
+      compstate[insert]=all
+      compstate[old_list]=keep
+      return 0
+    fi
+
+    [[ "$old" = *only* ]] && return 1
+  fi
+
+  (( $comppostfuncs[(I)_all_matches_end] )) ||
+      comppostfuncs=( "$comppostfuncs[@]" _all_matches_end )
+
+  return 1
+}
+
+_all_matches_end() {
+  if [[ "$compstate[nmatches]" -gt 1 ]]; then
+    local disp expl
+
+    _description all-matches expl 'all matches'
+    disp=('all matches...')
+    compadd "$expl[@]" -C -d disp
+  fi
+}
+
+_all_matches "$@"

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-10-10  8:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-10  8:11 Sven Wischnowsky [this message]
2000-10-10  8:18 ` OT: cvs usage Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
2000-10-10  7:29 all completions Sven Wischnowsky
2000-10-10  8:03 ` 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=200010100811.KAA22890@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --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).