zsh-workers
 help / color / mirror / code / Atom feed
* Re: Latest patched development version
@ 1999-01-11 10:05 Sven Wischnowsky
  1999-01-12 17:34 ` Bart Schaefer
  0 siblings, 1 reply; 15+ messages in thread
From: Sven Wischnowsky @ 1999-01-11 10:05 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> 
> A long time ago, in a year far far away, Sven Wischnowsky wrote:
> } Bruce Stephens wrote:
> } > Bruce Stephens <b.stephens@isode.com> writes:
> } > 
> } > > Completion seems to have vanished, but I just tried with zsh -f, and
> } > > it works again, so that's presumably just something that's changed
> } > > in the compctl syntax that's not being reported as an error.
> } > 
> } > I've found it.  It was this example completion:
> } > 
> } > compctl -Tx 's[/home/] C[0,^/home/*/*]'  -S '/' \
> } >     -s '$(niscat auto_home.org_dir | \
> } > 	awk '\''/export\/[a-zA-Z]*$/ {print $NF}'\'' FS=/)'
> } 
> } Peter's version contains my patch for completion continuing. With this 
> } we almost ever need a `-tc' in the `-T' completion.
> } 
> } (I said that trouble would come of that...)
> 
> Is there any reason that -tc simply can't be implicit?  That is, why not
> always continue with the next suitable completion, leaving -t+ -t- and -tx
> to change what "next suitable" means?  And then perhaps throw in something
> like -tn to mean "no, DON'T continue."
> 
> Seems to me it's more often the case that you want to go on trying other
> possible completions rather than giving up.  The default should be what
> the most common case is.

I wanted to leave the previous behavior unchanged as much as
possible. The `-T' is the only case where multiple compctl's were
tested in all other cases making -t<whatever> implicit would make
things differ from the way it was before my patches.
So we could make -tc implicit for -T (at least the `global' -tc,
before any -x). That would make things behave like they always did but 
I didn't like to add special cases at that time.
Anyway before I change anything I would like to hear a bit more what
people would like to have, ok?

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Latest patched development version
@ 1999-01-21  9:42 Sven Wischnowsky
  0 siblings, 0 replies; 15+ messages in thread
From: Sven Wischnowsky @ 1999-01-21  9:42 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> Is there any reason that -tc simply can't be implicit?  That is, why not
> always continue with the next suitable completion, leaving -t+ -t- and -tx
> to change what "next suitable" means?  And then perhaps throw in something
> like -tn to mean "no, DON'T continue."
> 
> Seems to me it's more often the case that you want to go on trying other
> possible completions rather than giving up.  The default should be what
> the most common case is.

(Even without getting more opinions on this I used some spare time to
build the patch below...)

After re-reading Bart's message I started to like the idea. So, the
patch below makes `-t' behave like Bart described above. The fact that 
the patch doesn't need to fiddle with zle_tricky.c shows that this
isn't that big a change in the concept of `-t'.
With this patch `-t' accepts only one character which says where to
continue to produce matches. Without any `-t' the next matching
compctl is used, since (as Bart already said) multiple matching
compctls weren't possible before (except for `-T') this shouldn't
introduce too much incompatibility. This also means that you don't
need `-tc' in `-T' or pattern compctls. On the other side, if you have 
a case where you don't want normal completion to be used, you should
add a `-tn' (so it's only a slight shift in incompatibilities to a
hopefully less common case).
Especially those who use `compctl -Tx 's[~]' -k friend ...' or
something like that to avoid the normal user-name generation should
put `-tn' in there or otherwise this will become pretty useless.

Any comments?

Bye
 Sven

diff -c os/Zle/compctl.c Src/Zle/compctl.c
*** os/Zle/compctl.c	Thu Jan 21 09:12:18 1999
--- Src/Zle/compctl.c	Thu Jan 21 10:12:04 1999
***************
*** 400,405 ****
--- 400,406 ----
      }
  
      memset((void *)&cct, 0, sizeof(cct));
+     cct.mask2 = CC_CCCONT;
  
      /* Loop through the flags until we have no more:        *
       * those with arguments are not properly allocated yet, *
***************
*** 516,541 ****
  			p = *++argv;
  			*argv = "" - 1;
  		    }
! 		    while (*p) {
! 			switch (*p) {
! 			case '+':
! 			    cct.mask2 |= CC_XORCONT;
! 			    break;
! 			case 'c':
! 			    cct.mask2 |= CC_CCCONT;
! 			    break;
! 			case '-':
! 			    cct.mask2 |= CC_PATCONT;
! 			    break;
! 			case 'x':
! 			    cct.mask2 |= CC_DEFCONT;
! 			    break;
! 			default:
! 			    zwarnnam(name, "invalid retry specification character `%c'",
! 				     NULL, *p);
! 			    return 1;
! 			}
! 			p++;
  		    }
  		}
  		break;
--- 517,544 ----
  			p = *++argv;
  			*argv = "" - 1;
  		    }
! 		    switch (*p) {
! 		    case '+':
! 			cct.mask2 = CC_XORCONT;
! 			break;
! 		    case 'n':
! 			cct.mask2 = 0;
! 			break;
! 		    case '-':
! 			cct.mask2 = CC_PATCONT;
! 			break;
! 		    case 'x':
! 			cct.mask2 = CC_DEFCONT;
! 			break;
! 		    default:
! 			zwarnnam(name, "invalid retry specification character `%c'",
! 				 NULL, *p);
! 			return 1;
! 		    }
! 		    if (p[1]) {
! 			zwarnnam(name, "too many retry specification characters: `%s'",
! 				 p + 1, 0);
! 			return 1;
  		    }
  		}
  		break;
***************
*** 835,840 ****
--- 838,844 ----
  		cc->xor = (Compctl) zcalloc(sizeof(*cc));
  		cc = cc->xor;
  		memset((void *)&cct, 0, sizeof(cct));
+ 		cct.mask2 = CC_CCCONT;
  	    }
  	}
      }
***************
*** 1362,1378 ****
  	    t >>= 1;
  	}
      }
!     if (flags2 & (CC_XORCONT | CC_CCCONT | CC_PATCONT | CC_DEFCONT)) {
  	printf(" -t");
  	if (flags2 & CC_XORCONT)
  	    putchar('+');
- 	if (flags2 & CC_CCCONT)
- 	    putchar('c');
  	if (flags2 & CC_PATCONT)
  	    putchar('-');
  	if (flags2 & CC_DEFCONT)
  	    putchar('x');
!     }
      /* now flags with arguments */
      printif(cc->mstr, 'M');
      if (flags2 & CC_NOSORT)
--- 1366,1381 ----
  	    t >>= 1;
  	}
      }
!     if (flags2 & (CC_XORCONT | CC_PATCONT | CC_DEFCONT)) {
  	printf(" -t");
  	if (flags2 & CC_XORCONT)
  	    putchar('+');
  	if (flags2 & CC_PATCONT)
  	    putchar('-');
  	if (flags2 & CC_DEFCONT)
  	    putchar('x');
!     } else if (!(flags2 & CC_CCCONT))
! 	printf(" -tn");
      /* now flags with arguments */
      printif(cc->mstr, 'M');
      if (flags2 & CC_NOSORT)
diff -c od/Zsh/compctl.yo Doc/Zsh/compctl.yo
*** od/Zsh/compctl.yo	Thu Jan 21 09:29:30 1999
--- Doc/Zsh/compctl.yo	Thu Jan 21 10:25:57 1999
***************
*** 85,91 ****
  to the user database is too slow and/or it contains too many users (so
  that completion after `tt(~)' is too slow to be usable), you can use
  
! nofill(tt(compctl -Tx  'C[0,*/*]' -f - 's[~]' -k friends -S/))
  
  to complete the strings in the array tt(friends) after a `tt(~)'.
  The first argument is necessary so that this form of ~-completion is
--- 85,91 ----
  to the user database is too slow and/or it contains too many users (so
  that completion after `tt(~)' is too slow to be usable), you can use
  
! nofill(tt(compctl -Tx  'C[0,*/*]' -f - 's[~]' -k friends -S/ -tn))
  
  to complete the strings in the array tt(friends) after a `tt(~)'.
  The first argument is necessary so that this form of ~-completion is
***************
*** 432,447 ****
  with the same name and the matches in those groups will not be mixed.
  )
  item(tt(-t) var(continue))(
! The var(continue)-string contains a set of characters that specify if 
! and when completion should continue to produce matches where it normally
! would not do that. The character tt(c) means that completion continues
! with the next suitable compctl (i.e. if you don't specify this in a
! tt(compctl -T), compctls for commands are never used). The character
! tt(PLUS()) is used to continue with the matches for the next alternative
! completion (see below). The characters tt(-) and tt(x) may be used in
! sub-lists for extended completion (see below). They will make the completion
! code use the flag list after the next tt(-) (if the corresponding pattern
! matches) and the default flag list (those before the tt(-x)), respectively.
  )
  item(tt(-M) var(match-spec))(
  This defines additional matching control specifications that should be used
--- 432,449 ----
  with the same name and the matches in those groups will not be mixed.
  )
  item(tt(-t) var(continue))(
! The var(continue)-string contains a character that specifies which set 
! of completion flags should be used next. Normally those of the next
! matching compctl are used, i.e. pattern compctls and normal compctls
! after tt(-T) and after a pattern compctl. If var(continue) is the
! character tt(PLUS()) the flags for the next alternative completion
! (see below) are used. The characters tt(-) and tt(x) can be used in
! sub-lists for extended completion (see below). They will make the
! completion code use the flag list after the next tt(-) (if the
! corresponding pattern matches) and the default flag list (those before
! the tt(-x)), respectively. if var(continue) is the character tt(n) no
! other flag lists are used, i.e. the generation of matches stops
! immediately.
  )
  item(tt(-M) var(match-spec))(
  This defines additional matching control specifications that should be used

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


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Latest patched development version
@ 1998-12-15 14:57 Sven Wischnowsky
  1999-01-11  2:38 ` Bart Schaefer
  0 siblings, 1 reply; 15+ messages in thread
From: Sven Wischnowsky @ 1998-12-15 14:57 UTC (permalink / raw)
  To: zsh-workers


Bruce Stephens wrote:

> 
> Bruce Stephens <b.stephens@isode.com> writes:
> 
> > Completion seems to have vanished, but I just tried with zsh -f, and
> > it works again, so that's presumably just something that's changed
> > in the compctl syntax that's not being reported as an error.
> 
> I've found it.  It was this example completion:
> 
> # This is to complete all directories under /home, even those that are not
> # yet mounted (if you use the automounter).
> 
> # This is for NIS+ (e.g. Solaris 2.x)
> compctl -Tx 's[/home/] C[0,^/home/*/*]'  -S '/' -s '$(niscat auto_home.org_dir | \
> 	awk '\''/export\/[a-zA-Z]*$/ {print $NF}'\'' FS=/)'
> 
> Which doesn't work for me anyway (since directories are mounted
> differently), so I've just commented it out.  Things were working with
> previous versions of zsh, however, so this suggests that something has
> changed.

Peter's version contains my patch for completion continuing. With this 
we almost ever need a `-tc' in the `-T' completion.

(I said that trouble would come of that...)

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re:  Latest patched development version
@ 1998-12-15 11:59 Sven Wischnowsky
  1998-12-15 13:05 ` Peter Stephenson
  1998-12-15 14:03 ` Bruce Stephens
  0 siblings, 2 replies; 15+ messages in thread
From: Sven Wischnowsky @ 1998-12-15 11:59 UTC (permalink / raw)
  To: zsh-workers


Hello

The changes in the configuration for AIXDYNAMIC (or whatever) have the
effect that it now thinks it can't build dynamic loadable modules on
Digital Unix 4.0. One problem is that the tests for load, unload,
loadbind, and loadquery fail.

I'm not in the mood to look any deeper into this now, maybe later...

While fighting with this I also got an error in utils.c. In the
function get_username() after the `#else' the variable current_uid is
used but not defined.

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Latest patched development version
@ 1998-12-14 13:57 Peter Stephenson
  1998-12-14 17:05 ` Bruce Stephens
  1998-12-14 18:54 ` Phil Pennock
  0 siblings, 2 replies; 15+ messages in thread
From: Peter Stephenson @ 1998-12-14 13:57 UTC (permalink / raw)
  To: Zsh hackers list

I have put a new patched version of zsh 3.1.5 at

http://www.ifh.de/~pws/computing/zsh-3.1.5-pws-3.tar.gz

(the previous file zsh-3.1.5-patched.tar.gz has now disappeared).
It has the version number 3.1.5-pws-3 even though 1 and 2 weren't
numbered.  The following is a list of additions since the previous
version.  I am being less conservative than Zefram will presumably be
when 3.1.6 appears (I notice Zefram's keeping very quiet).  Note in
particular zftp, which is by no means guaranteed to compile on all
machines yet; there isn't even yet a not-even-attempting-to-compile
test (probably the presence of socket() would be a good one for that).
Fairly detailed reports about headers and libraries would be helpful.
If the worst comes to the worst, stick #if 0...#endif around the code
in Src/Modules/zftp.c .


4482 (cdmatch2)and 4641 (${assoc[0]}) now applied; 4641 was supposed
to be there before.

nroff manual pages deleted, you now need yodl.

deleted modules-bltin by hand, which `make distclean' somehow missed.
Caused problems when building a statically linked shell.

Bart's scanmatchtable fix, 4674

Commented out vifirstnonblank() in vioperswapcase(), pending any
better patch for it.

Bart's viforwardword fix, 4678

My case-independent globbing fix (case-independent testing was broken
after a top level *), 4693

Sven's zle_tricky.c, 4697

Sven's patch to ignore completions if the cursor is not in a part to
be completed, 4698, plus addition, 4707

I have not added Sven's zerr() patch, 4699, in case it has side
effects, but I haven't heard anything on the subject and I haven't
looked at it.

Sven's pennockite heap memory patch, 4700

Sven's condition module patch, 4716, and addition, 4732, and the
function wrapper patch, 4734, and additions, 4742, 4769: the module.c
bits of these have been moved around a little to avoid clashes with
the AIXDYNAMIC stuff.  The wrapper stuff is still not finished, but
doesn't currently impinge on use of the shell.

Phil Pennock's patch to use associative arrays in stat, 4727

Unposted fix for use of printcompctlptr in completion widgets:
printcompctl() had acquired another argument.  (None of the mucking
around with completion widgets to fit in with the latest completion
code has been separately posted.)

My bash-like ${foo/orig/new} patch, 4736, and the version to do
shortest matching together with optimizations of all pattern matching
in variable strings, 4754.

Phil's patch for typeset -a docs, 4737

Nobody wanted my fix for `FOO=x eval external', so it's not there.

zftp, 4761

Bart's fix for conddef without dynamical modules, 4762

Bart's associative array patches for implentation of subscripting flags,
4763, plus fix 4766; typeset output 4764

Sven's completion listing fix, 4767

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

end of thread, other threads:[~1999-01-21  9:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-11 10:05 Latest patched development version Sven Wischnowsky
1999-01-12 17:34 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1999-01-21  9:42 Sven Wischnowsky
1998-12-15 14:57 Sven Wischnowsky
1999-01-11  2:38 ` Bart Schaefer
1998-12-15 11:59 Sven Wischnowsky
1998-12-15 13:05 ` Peter Stephenson
1998-12-15 14:03 ` Bruce Stephens
1998-12-15 14:44   ` Bruce Stephens
1998-12-14 13:57 Peter Stephenson
1998-12-14 17:05 ` Bruce Stephens
1998-12-14 17:27   ` Peter Stephenson
1998-12-14 17:31   ` Bruce Stephens
1998-12-14 18:54 ` Phil Pennock
1998-12-14 20:13   ` Bart Schaefer

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