zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Cc: Vincent Lefevre <vincent@vinc17.org>
Subject: PATCH: Re: blah*[TAB] (difference between 3.1.6 and 3.1.9)
Date: Tue, 6 Jun 2000 14:58:37 +0200 (MET DST)	[thread overview]
Message-ID: <200006061258.OAA09450@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Vincent Lefevre's message of Tue, 6 Jun 2000 11:22:25 +0200


[ moved to -workers and CC'ed to Vincent ]

Vincent Lefevre wrote:

> On Tue, Jun 06, 2000 at 03:20:38 +0000, Bart Schaefer wrote:
> > As a workaround, the following should behave the way you want:
> > 
> > bindkey '\t' complete-word
> > autoload -U compinit
> > compinit
> > zstyle ':completion:*' completer _expand _complete
> > zstyle ':completion:*:expand:::' glob 1
> > zstyle ':completion:*:expand:::' substitute 1
> > 
> > If you have some customized compctl commands, you may also want:
> > 
> > zstyle ':completion:*' use-compctl 1
> 
> If I use this (at the end of my .zshrc), variable names completion
> doesn't work any longer. For instance, I type "echo $ZSH_V":
> 
> Et encore? echo $ZSH_V
> 
> then [TAB], and I get:
> 
> Et encore? echo #
>          $ZSH_V
> 
> where '#' represents the cursor.

The _expand completer offers you the expansion of $ZSH_V (an empty
string) and the original and enters menu-completion so that you can
toggle between the two (with the `expansion' being inserted in the
line immediately).

Hm, maybe we shouldn't use `empty' expansions.

And if I'm not completely mistaken, that test for add-space should eb
the other way round.

And to get nearer to the expand-or-complete behaviour, you should also 
use:

  zstyle ':completion:*:expand:*' tag-order all-expansions

That will make it insert only all the expansions in the line, not
allowing you to menu between the original string, the expansions
one-by-one and all expansions at once.

Bye
 Sven

Index: Completion/Core/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v
retrieving revision 1.13
diff -u -r1.13 _expand
--- Completion/Core/_expand	2000/05/31 09:38:26	1.13
+++ Completion/Core/_expand	2000/06/06 12:51:44
@@ -54,7 +54,7 @@
 
 # If the array is empty, store the original string again.
 
-(( $#exp )) || exp=("$word")
+[[ -z "$exp" ]] && exp=("$word")
 
 subd=("$exp[@]")
 
@@ -92,7 +92,7 @@
 if (( $#exp == 1 )); then
   if [[ -d $exp && "$exp[1]" != */ ]]; then
     suf=/
-  elif zstyle -T ":completion:${curcontext}:" add-space; then
+  elif ! zstyle -T ":completion:${curcontext}:" add-space; then
     suf=
   fi
 fi

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


             reply	other threads:[~2000-06-06 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-06 12:58 Sven Wischnowsky [this message]
2000-06-06 15:57 ` Bart Schaefer
2000-06-06 16:44   ` Bart Schaefer
2000-06-08  7:18 Sven Wischnowsky

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=200006061258.OAA09450@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=vincent@vinc17.org \
    --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).