about summary refs log tree commit diff
path: root/Src/module.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-05-29 14:16:02 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-05-29 14:16:02 +0000
commit29b7123647bc3b70911bbb2caf85238d22d160c8 (patch)
tree7385597437e723b4471a6bd1061a5a2fdd2b7017 /Src/module.c
parent3fbbdf245b7367c4b34492b630450c004a43eed7 (diff)
downloadzsh-29b7123647bc3b70911bbb2caf85238d22d160c8.tar.gz
zsh-29b7123647bc3b70911bbb2caf85238d22d160c8.tar.xz
zsh-29b7123647bc3b70911bbb2caf85238d22d160c8.zip
23485: feature completion and autoloading
Diffstat (limited to 'Src/module.c')
-rw-r--r--Src/module.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/Src/module.c b/Src/module.c
index 8f5afca83..a6329850e 100644
--- a/Src/module.c
+++ b/Src/module.c
@@ -389,7 +389,7 @@ getconddef(int inf, char *name, int autol)
 	    /* This is a definition for an autoloaded condition, load the *
 	     * module if we haven't tried that already. */
 	    if (f) {
-		(void)load_module_silence(p->module, NULL, 0);
+		(void)ensurefeature(p->module, "c:", name);
 		f = 0;
 		p = NULL;
 	    } else {
@@ -907,7 +907,7 @@ getmathfunc(char *name, int autol)
 
 		removemathfunc(q, p);
 
-		(void)load_module_silence(n, NULL, 0);
+		(void)ensurefeature(n, "f:", name);
 
 		return getmathfunc(name, 0);
 	    }
@@ -2850,7 +2850,7 @@ setfeatureenables(char const *nam, Features f, int *e)
 	ret = 1;
     return ret;
 }
-	    
+
 /**/
 mod_export int
 handlefeatures(char *nam, Features f, int **enables)
@@ -2860,3 +2860,20 @@ handlefeatures(char *nam, Features f, int **enables)
     *enables = getfeatureenables(nam, f);
     return 0;
 }
+
+/*
+ * Ensure module "modname" is providing feature with "prefix"
+ * and "feature" (e.g. "b:", "limit").
+ */
+
+/**/
+mod_export int
+ensurefeature(char *modname, char *prefix, char *feature)
+{
+    char *f = dyncat(prefix, feature);
+    char *features[2];
+
+    features[0] = f;
+    features[1] = NULL;
+    return require_module(NULL, modname, features);
+}