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

autoload failing



-----BEGIN PGP SIGNED MESSAGE-----

This patch stops failed module autoloads being attempted again.  This is
particularly useful with the zle module: currently an autoload will be
attempted every time the main prompt is reached while it is not loaded.

 -zefram

 *** Src/builtin.c	1997/03/17 14:23:38	1.62
 --- Src/builtin.c	1997/03/20 13:04:52
 ***************
 *** 60,65 ****
 --- 60,66 ----
   #ifdef DYNAMIC
       if (!bn->handlerfunc) {
   	zwarnnam(name, "autoload failed", NULL, 0);
 + 	deletebuiltin(bn->nam);
   	return 1;
       }
   #endif
 *** Src/init.c	1997/03/19 00:21:09	1.41
 --- Src/init.c	1997/03/20 13:13:33
 ***************
 *** 790,796 ****
 --- 790,800 ----
   ZleVoidFn gotwordptr = noop_function;
   ZleVoidFn refreshptr = noop_function;
   ZleVoidIntFn spaceinlineptr = noop_function_int;
 + # ifdef UNLINKED_XMOD_zle
 + ZleReadFn zlereadptr = autoload_zleread;
 + # else /* !UNLINKED_XMOD_zle */
   ZleReadFn zlereadptr = fallback_zleread;
 + # endif /* !UNLINKED_XMOD_zle */
   
   /**/
   void
 ***************
 *** 806,811 ****
 --- 810,828 ----
       /* do nothing */
   }
   
 + # ifdef UNLINKED_XMOD_zle
 + 
 + /**/
 + unsigned char *
 + autoload_zleread(char *lp, char *rp)
 + {
 +     zlereadptr = fallback_zleread;
 +     load_module("zle");
 +     return zleread(lp, rp);
 + }
 + 
 + # endif /* UNLINKED_XMOD_zle */
 + 
   /**/
   unsigned char *
   fallback_zleread(char *lp, char *rp)
 ***************
 *** 813,822 ****
       char *pptbuf;
       int pptlen;
   
 - #ifdef UNLINKED_XMOD_zle
 -     if (load_module("zle"))
 - 	return zleread(lp, rp);
 - #endif /* UNLINKED_XMOD_zle */
       pptbuf = putprompt(lp, &pptlen, NULL, 1);
       write(2, (WRITE_ARG_2_T)pptbuf, pptlen);
       free(pptbuf);
 --- 830,835 ----

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: ascii

iQCVAwUBMzFDBXD/+HJTpU/hAQH8TgQAoDGAJ2caaTkuWDFGOj4csh2EtnikEdb+
J/m3u1cnDPhKYj1fK2PsteNjIFuaELBSFaftoCTANFdhfjYEu/ZkTitSQG3W8guv
eFnUxZFaNWYPDAOxM0LyEwLndGuxJB4KgWw9I9aSl/ES+5nmxgyDJBdIWdkMBSbf
OFdoHKoMDwI=
=nXo9
-----END PGP SIGNATURE-----



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