zsh-workers
 help / color / mirror / code / Atom feed
* what is removing the space after completion and before "|"?
@ 2002-03-09 10:03 Derek Peschel
  2002-03-09 10:34 ` John Beppu
  0 siblings, 1 reply; 7+ messages in thread
From: Derek Peschel @ 2002-03-09 10:03 UTC (permalink / raw)
  To: zsh-workers

I hit tab to complete a filename, I type "|", and the space gets erased.
Is this goverened by one of the AUTO_... options or something else?

Thanks,

-- Derek


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

* Re: what is removing the space after completion and before "|"?
  2002-03-09 10:03 what is removing the space after completion and before "|"? Derek Peschel
@ 2002-03-09 10:34 ` John Beppu
  2002-03-09 18:20   ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: John Beppu @ 2002-03-09 10:34 UTC (permalink / raw)
  To: zsh-workers

<aol>
    I've been wondering the same thing....
</aol>


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

* Re: what is removing the space after completion and before "|"?
  2002-03-09 10:34 ` John Beppu
@ 2002-03-09 18:20   ` Bart Schaefer
  2002-03-10  5:45     ` Derek Peschel
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2002-03-09 18:20 UTC (permalink / raw)
  To: Derek Peschel, zsh-workers, John Beppu

On Mar 9,  2:03am, Derek Peschel wrote:
}
} I hit tab to complete a filename, I type "|", and the space gets erased.
} Is this goverened by one of the AUTO_... options or something else?

It depends.

With default builtin completions, suffix removal is controlled by the
slightly-misnamed AUTO_REMOVE_SLASH option.

If you extend the default completions with `compctl', it depends on the
-q option having been passed to compctl.

With new completion -- when you run `compinit' from your startup files --
it depends on the definitions of the individual completion functions,
which really means it depended on the preferences of the person who
wrote the function for us.


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

* Re: what is removing the space after completion and before "|"?
  2002-03-09 18:20   ` Bart Schaefer
@ 2002-03-10  5:45     ` Derek Peschel
  2002-03-11  9:54       ` Sven Wischnowsky
  0 siblings, 1 reply; 7+ messages in thread
From: Derek Peschel @ 2002-03-10  5:45 UTC (permalink / raw)
  To: zsh-workers

On Sat, Mar 09, 2002 at 06:20:56PM +0000, Bart Schaefer wrote:
> On Mar 9,  2:03am, Derek Peschel wrote:

> } I hit tab to complete a filename, I type "|", and the space gets erased.
> } Is this goverened by one of the AUTO_... options or something else?
> 
> It depends.
> 
> With default builtin completions, suffix removal is controlled by the
> slightly-misnamed AUTO_REMOVE_SLASH option.

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.

Is compresult.c the only file that deals with suffixes?

-- Derek


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

* Re: what is removing the space after completion and before "|"?
  2002-03-10  5:45     ` Derek Peschel
@ 2002-03-11  9:54       ` Sven Wischnowsky
  2002-03-14 10:59         ` Derek Peschel
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Wischnowsky @ 2002-03-11  9:54 UTC (permalink / raw)
  To: zsh-workers


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.

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

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'm starting to like hacking zsh again, so I might even start playing
with this as long as I'm stuck on the other two recent open issues
(fake and the -[JV] problem and defaults as in the my-accounts case --
but see the mail I'm writing in a few minutes for this).


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@berkom.de


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

* Re: what is removing the space after completion and before "|"?
  2002-03-11  9:54       ` Sven Wischnowsky
@ 2002-03-14 10:59         ` Derek Peschel
  2002-03-14 11:15           ` Sven Wischnowsky
  0 siblings, 1 reply; 7+ messages in thread
From: Derek Peschel @ 2002-03-14 10:59 UTC (permalink / raw)
  To: zsh-workers

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


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

* Re: what is removing the space after completion and before "|"?
  2002-03-14 10:59         ` Derek Peschel
@ 2002-03-14 11:15           ` Sven Wischnowsky
  0 siblings, 0 replies; 7+ messages in thread
From: Sven Wischnowsky @ 2002-03-14 11:15 UTC (permalink / raw)
  To: zsh-workers


Derek Peschel wrote:

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

Oi. I see. That builtin stuff is actually compctl used internally when
no other completion code was loaded while processing the init files.

Use the new completion system to really see suffixes in action (with
all their problems).

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

Yes, that one is used to register that there was a suffix added, n
characters long, which should automatically be removed when some space
or one of the characters that separates commands is typed next.

(So, if you just want to get rid of that auto-removal when inserting
`|', `&' or `;', just uncomment/remove these at zle_misc.c:881, but
don't expect us to include that patch in the distribution ;-)

maksuffix()'s brothers and sisters are used to register more
complicated types of suffixes.

I'm currently trying to collect my ideas about suffixes and will
eventually come up with a list and a description of how I think all of
this could be implemented.


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@berkom.de


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

end of thread, other threads:[~2002-03-14 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-09 10:03 what is removing the space after completion and before "|"? Derek Peschel
2002-03-09 10:34 ` John Beppu
2002-03-09 18:20   ` Bart Schaefer
2002-03-10  5:45     ` Derek Peschel
2002-03-11  9:54       ` Sven Wischnowsky
2002-03-14 10:59         ` Derek Peschel
2002-03-14 11:15           ` Sven Wischnowsky

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