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

Re: Global aliases, eval, and completion (Re: Expanding interactively aliases)



Bart Schaefer wrote:

> ...
> 
> Having already implemented `autoload -U', we could now easily add a zsh
> option `noalias' akin to `noglob', and then add that to $_comp_options.
> Then completion functions that specifically wanted aliases could restore
> the `alias' option in the scope where they wanted it.

Hmhm, I was thinking about something similar...

> Which incidentally leads me to wonder if bufferwords() doesn't have a
> potential bug in that it forces the C variable `noaliases' to 1 and 0
> without saving/restoring it?  I suppose as currently used `noaliases'
> can't possibly be anything other than 0 during bufferwords() ...

Better make sure... (thanks for finding it).


Bye
 Sven

Index: Src/hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hist.c,v
retrieving revision 1.22
diff -u -r1.22 hist.c
--- Src/hist.c	2001/02/19 10:26:54	1.22
+++ Src/hist.c	2001/02/26 09:41:32
@@ -2151,6 +2151,7 @@
 {
     int num = 0, cur = -1, got = 0, ne = noerrs, ocs = cs, oll = ll;
     int owb = wb, owe = we, oadx = addedx, ozp = zleparse, onc = nocomments;
+    int ona = noaliases;
     char *p;
 
     if (!list)
@@ -2226,7 +2227,7 @@
     }
     if (cur < 0 && num)
 	cur = num - 1;
-    noaliases = 0;
+    noaliases = ona;
     strinend();
     inpop();
     errflag = 0;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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