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

Re: PATCH: Re: Completion and global aliases



On Jun 9,  9:48am, Peter Stephenson wrote:
} Subject: Re: PATCH: Re: Completion and global aliases
}
} "Bart Schaefer" wrote:
} > The following patch implements `autoload -U ...' for this.  Hmm, I didn't
} > change `functions' to output anything for "unaliased" state; should it?
} 
} It's hard to know where to put it that isn't going to confuse matters,
} either because someone has code to search for `undefined', or because the
} next word is taken as the function name, etc.  Maybe as long as `functions
} -uU' works OK it's good enough.

Unfortunately, "functions -uU" can't do the "right" thing because functions
with the unaliased flag also have the undefined flag, and scanhashtable()
prints nodes that have any of the requested flags (not nodes that have all
of them).  Maybe the following is OK:

Index: Src/builtin.c
***************
*** 1846,1851 ****
--- 1846,1853 ----
       * are given, we will print only functions containing these  *
       * flags, else we'll print them all.                         */
      if (!*argv) {
+ 	if (ops['U'] && !ops['u'])
+ 	    on &= ~PM_UNDEFINED;
  	scanhashtable(shfunctab, 1, on|off, DISABLED, shfunctab->printnode, 0);
  	return 0;
      }

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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