zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: Re: Completion for mutt
@ 2000-02-15 12:22 Sven Wischnowsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2000-02-15 12:22 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> I just tried, too, and after the fix in the patch below, it works for
> me. What does `doesn't work' mean? Does it nothing?

Uh oh...

Bye
 Sven

diff -ru ../z.old/Src/Zle/compctl.c Src/Zle/compctl.c
--- ../z.old/Src/Zle/compctl.c	Tue Feb 15 11:32:51 2000
+++ Src/Zle/compctl.c	Tue Feb 15 13:15:03 2000
@@ -1837,7 +1837,7 @@
 		for (n = firstnode(ccused); n; incnode(n))
 		    addlinknode(lastccused, getdata(n));
 	    } LASTALLOC;
-	} else
+	} else if (ccused)
 	    for (n = firstnode(ccused); n; incnode(n))
 		if (((Compctl) getdata(n)) != &cc_dummy)
 		    freecompctl((Compctl) getdata(n));
@@ -2497,6 +2497,8 @@
 makecomplistcc(Compctl cc, char *s, int incmd)
 {
     cc->refc++;
+    if (!ccused)
+	ccused = newlinklist();
     addlinknode(ccused, cc);
 
     ccont = 0;
@@ -2955,11 +2957,13 @@
 
     ccont |= (cc->mask2 & (CC_CCCONT | CC_DEFCONT | CC_PATCONT));
 
-    if (incompfunc != 1 && findnode(ccstack, cc))
+    if (incompfunc != 1 && ccstack && findnode(ccstack, cc))
 	return;
 
     MUSTUSEHEAP("complistflags");
 
+    if (!ccstack)
+	ccstack = newlinklist();
     addlinknode(ccstack, cc);
 
     if (incompfunc != 1 && allccs) {

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: Re: Completion for mutt
@ 2000-02-15 13:17 Sven Wischnowsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2000-02-15 13:17 UTC (permalink / raw)
  To: zsh-workers


Ollivier Robert wrote:

> ...
>  
> > above is used only for compctls. The completion system uses the
> > _matcher completer, see the compsys manual/info (there is also a bit
> > of discussion about this going on...).
> 
> I've had a look at it. I've tried the example given (which seems similar in
> goal as the old compctl thing) but I still can complete in a
> case-independant fashion.
> 
> echo $zs<TAB>v<TAB>
> 
> used to complete into
> 
> echo $ZSH_VERSION
> 
> Likewise, I was able to do 
> 
> more /usr/src/etc/mak<TAB>
> 
> and have choice between "make.conf", "Makefile" and "MAKEDEV". Now, only
> "make.conf" is given.
> 
> I do appreciate the nice efforts you're all putting into the new completion
> system but I think it is becoming very complicated to configure...

This makes me cry for help...

> I have this:
> 
> zstyle ':completion:::::' completer _matcher _complete _matcher _complete
> zstyle ':completion:*:matcher-1:::' matcher 'm:{a-z-}={A-Z_}'
> zstyle ':completion:*:matcher-2:::' matcher 'm:{a-z-}={A-Z_}' 'r:|[-_./]=* r:|=*'
> 
> I'm confused.

I'm confused, too, because it works for me... maybe some missing
patch of those that have appeared after dev-18.


Btw, when I wrote _matcher I was tempted to change _main_complete to
allow it to give arguments to completers, taken from the style, as in

  zstyle ... completer '_matcher m:{a-z}={A-Z}' _complete ...

Or maybe make _main_complete just eval the things and let the global
match specs be stored in a user visible parameter:

  zstyle ... completer matcher='m:{a-z}={A-Z}' _complete ...

Dunno if any of this would be better (it may be hard to decide what to 
do with styles and what to do with arguments/other means).

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: Re: Completion for mutt
  2000-02-15 12:20 Sven Wischnowsky
@ 2000-02-15 12:46 ` Ollivier Robert
  0 siblings, 0 replies; 4+ messages in thread
From: Ollivier Robert @ 2000-02-15 12:46 UTC (permalink / raw)
  To: zsh-workers

According to Sven Wischnowsky:
> I just tried, too, and after the fix in the patch below, it works for
> me. What does `doesn't work' mean? Does it nothing?

Will try the patch in your next message.
 
> above is used only for compctls. The completion system uses the
> _matcher completer, see the compsys manual/info (there is also a bit
> of discussion about this going on...).

I've had a look at it. I've tried the example given (which seems similar in
goal as the old compctl thing) but I still can complete in a
case-independant fashion.

echo $zs<TAB>v<TAB>

used to complete into

echo $ZSH_VERSION

Likewise, I was able to do 

more /usr/src/etc/mak<TAB>

and have choice between "make.conf", "Makefile" and "MAKEDEV". Now, only
"make.conf" is given.

I do appreciate the nice efforts you're all putting into the new completion
system but I think it is becoming very complicated to configure...

I have this:

zstyle ':completion:::::' completer _matcher _complete _matcher _complete
zstyle ':completion:*:matcher-1:::' matcher 'm:{a-z-}={A-Z_}'
zstyle ':completion:*:matcher-2:::' matcher 'm:{a-z-}={A-Z_}' 'r:|[-_./]=* r:|=*'

I'm confused.
-- 
Ollivier ROBERT -=- Eurocontrol EEC/TEC -=- roberto@eurocontrol.fr
The Postman hits! The Postman hits! You have new mail.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* PATCH: Re: Completion for mutt
@ 2000-02-15 12:20 Sven Wischnowsky
  2000-02-15 12:46 ` Ollivier Robert
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 2000-02-15 12:20 UTC (permalink / raw)
  To: zsh-workers


Ollivier Robert wrote:

> > If you want to say that it doesn't complete the right thing after
> > loading the new completion system -- right, there doesn't seem to be a 
> > completion function for these commands.
> 
> I thought the new completion was compatible with the old one (i.e. having
> compctl would still work).

No, only on request nowadays...

> > If you want to say that after loading the new completion system the
> > compctl doesn't seem to be used -- right, see the function _default
> > in the Base subdirectory of the distribution. You can un-comment a
> > call to `compcall' there to make compctl's be used when there is no
> > completion function for a certain command.
> 
> I have uncommented this line but the old mutt completion rule still doesn't
> work.

I just tried, too, and after the fix in the patch below, it works for
me. What does `doesn't work' mean? Does it nothing?

> Now, I just found that what I used to make completion case-independent (see
> below) doesn't work anymore. With dev-16 it was still working.
> 
> compctl -M 'm:{a-z}={A-Z} m:{A-Z}={a-z}'
> 
> Now, I can't complete independantly of the case :-(

This has just changed (and for the new completion system using the
$compmatchers arrays was the preferred way for quite some time because 
that didn't load the compctl module). Now the `compctl -M' you gave
above is used only for compctls. The completion system uses the
_matcher completer, see the compsys manual/info (there is also a bit
of discussion about this going on...).

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-02-15 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-15 12:22 PATCH: Re: Completion for mutt Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-02-15 13:17 Sven Wischnowsky
2000-02-15 12:20 Sven Wischnowsky
2000-02-15 12:46 ` Ollivier Robert

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).