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

Re: compclt-problem in beta21



> Hi,
> 
> I have this compctl-line in my .zshrc:
> 
>     compctl -x 's[+] c[-1,-f],s[-f+]' -g '~/Mail/*(:t)' \
>              - 's[-f],c[-1,-f]' -f -- elm
> 
> (virtually the same as in the man-page)
> 
> This used to work fine up to beta17 (my latest version), but it does
> not work with beta21 anymore. Specifically, it does not expand the
> files in my ~/Mail directory. I.e:

Are you sure it did work in beta17?  The problem is that ~ is not a glob
character unless extendedglob is set.  Also tilde and equals substitution
is not part of globbing, and the manual says that -g expands glob patterns.
So zsh just behaves as documented.  But the source code and the existing
practise suggests that this is really a bug.  In beta21, tokenize() only
tokenizes glob special characters.  The patch below should fix that problem
by tokenizing leading ~ and =.

Zoltan

*** Src/zle_tricky.c	1996/06/15 02:20:10	2.50
--- Src/zle_tricky.c	1996/06/20 12:47:50
***************
*** 2673,2678 ****
--- 2673,2682 ----
  			    *p = '\0';
  			    /* Get the pattern string. */
  			    tokenize(g = dupstring(g));
+ 			    if (*g == '=')
+ 				*g = Equals;
+ 			    if (*g == '~')
+ 				*g = Tilde;
  			    remnulargs(g);
  			    if (*g == Equals || *g == Tilde) {
  				/* The pattern has a `~' or `=' at the  *




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