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

Re: fixsuffix() again




"Bart Schaefer" wrote:

> On Nov 6,  9:16am, Sven Wischnowsky wrote:
> } Subject: Re:  fixsuffix() again
> }
> } Bart Schaefer wrote:
> } > Sven, one of your patch hunks in zsh-workers/4510 removes a call to
> } > fixsuffix() from the top of docompletion().  Is this intentional or not?
> } 
> } I have no idea where this fixsuffix() in docompletion() comes from
> 
> Looks like Zefram added it when he did the 3.1.5 release.  It's not in
> any version I have in CVS until after I import the 3.1.5 code and merge.
> 
> } As I wrote in another message this may be a issue of personal
> } taste. If we put a fixsuffix() there any suffix on the line that is
> } autoremovable will become fixed when completion is tried in any way
> } (listing matches, completion with no matches, ...).
> 
> So you mean with that one call to fixsuffix() in docompletion() we can
> get rid of all the other calls to fixsuffix() scattered about in other
> places?  If so, then by golly I vote for putting that one back and
> nuking the others.

The one in deletecharorlist() will still be need since it is in the
branch where completion is noct called. So it would make two instead
of three calls in zle_tricky.c. The patch below does this, but note
that there is one ugliness:

In the main zsh directory do:

  ls Sr<TAB>

giving you

  ls Src/

now type C-d, you get the matches in Src, then type a space. With
fixsuffix() in docompletion() the slash is not removed, but with the
old style it is.

Bye
 Sven

*** os/Zle/zle_tricky.c	Fri Nov  6 10:09:42 1998
--- Src/Zle/zle_tricky.c	Fri Nov  6 10:10:19 1998
***************
*** 2927,2932 ****
--- 2927,2934 ----
  static void
  docompletion(char *s, int lst, int incmd)
  {
+     fixsuffix();
+ 
      HEAPALLOC {
  	pushheap();
  
***************
*** 4807,4814 ****
  	if (!ainfo)
  	    return;
  
- 	fixsuffix();
- 
  	/* Delete the old stuff from the command line. */
  	cs = wb;
  	foredel(we - wb);
--- 4809,4814 ----
***************
*** 4938,4945 ****
      if (!prpre) prpre = "";
      if (!ppre) ppre = "";
      if (!psuf) psuf = "";
- 
-     fixsuffix();
  
      if (!menucur) {
  	/* We are currently not in a menu-completion, *
--- 4938,4943 ----


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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