Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: what is removing the space after completion and before "|"?



On Mon, Mar 11, 2002 at 10:54:50AM +0100, Sven Wischnowsky wrote:
> 
> Derek Peschel wrote:
> 
> > ...
> > 
> > I'm using the old completion system and I haven't tried compctl.  I don't
> > think AUTO_REMOVE_SLASH has any effect in the particular case of spaces
> > before pipe characters (I tried it both ways).  This is with a 4.1
> > development version.
> 
> compctl is the old one, the completion system is the new one.

I mean I haven't run compinit or compctl, I'm just using the built-in
options.

> > Is compresult.c the only file that deals with suffixes?
> 
> Everthing needed for this, yes.  But we have to rely on the zle module
> to really remove the suffix (since at that time, the completion system
> isn't running any more).

Now I suspect the makesuffix function.  I think what's happening is this:

	- I hit Tab to do the completion
	- a space gets added as a suffix
	- I type an ampersand or vertical bar
	- the "remove the same character as a suffix" code runs
	- by the special cases in makesuffix the space is treated
	  as if it were an ampersand or vertical bar

Why are those special cases in makesuffix anyway?  Do "&" or "|" ever
get added as suffixes?

If we want to keep the special cases we'll probably have to arrange that
they all be equivalent to each other for makesuffix's purposes, but that
each one only be equivalent to itself for the purposes of the "remove the
same character" rule.

> But.  We had some discussion about suffix handling some time ago
> (sorry, don't have the message IDs here).  I've mostly been thinking
> (or dreaming) about moving mor of the code into shell code for more
> flexibilty and greater configurability.  I didn't have time to hack,
> though, and it isn't easy without changing several parts of the C- and
> shell-code.
> 
> I don't object if you want to hack that part of the code (everyone who
> wants to work his way into the completion code is welcome), but I
> don't want new shell options to appear for this (or I'll remove them
> again when I find the time to tackle the suffix problem).
> 
> Maybe you have other ideas about suffix handling and could tell us
> about them?  So that we could come up with a list of desired features
> to help us implement that.

I haven't spent enough time with the shell to understand the code at a
broad level.  I'm just playing with specific features to get the behavior
I want.  Though I do realize that a small change in the code can affect
lots of other things.

If I start to really understand the power of the completion system, and
come up with other ideas, I'll let the list know.

-- Derek



Messages sorted by: Reverse Date, Date, Thread, Author