ZyX_I avatar ZyX_I committed b35071d

Improved newfeature:cons and :load documentation, added delfunctions and, partially, addextfunctions documentation

Comments (0)

Files changed (1)

         cons       Reference to a function that will take |frawor-t-plugdict| as 
                    its first argument and, possibly, some additional arguments. 
                    It is just a normal function that can do anything related to 
-                   the plugin that uses frawor. When plugin is registered, 
-                   function that is a wrapper to this function will be added to 
-                   s:F._frawor dictionary.
+                   the plugin that uses frawor. Function that is a wrapper to 
+                   this function will be added to s:F._frawor dictionary under 
+                   the same conditions for which `load' function is called 
+                   (except that `ignoredeps' option has no effect).
         load       Reference to a function that will take |frawor-t-plugdict| as 
                    its first argument. This function will be called only once 
                    for each plugin that depends on the plugin that registers 
-                   this feature. Function will be called when dependent plugin 
-                   is loaded. If value returned by this function is not 0, then 
-                   it will be assigned to plugdict.features[{fid}]
+                   this feature. If value returned by this function is not 0, 
+                   then it will be assigned to plugdict.features[{fid}].
+                   Function will be called under following circumstances:
+                   1. If feature definer (plugin that registered feature) was 
+                      loaded before plugin that requires it, then it will be 
+                      called just before plugin will be loaded.
+                   2. If feature definer was loaded after plugin that requires 
+                      it, then it will be called just after feature definer is 
+                      loaded.
         init       Any value. Deep copy (|deepcopy()|) of it will be assigned to 
                    plugdict.features[{fid}]. Note that if `load' key is present, 
                    then this key will be ignored.
                    plugin which defined this feature in dependencies (feature 
                    definer). Key `cons' will be ignored for plugins that do not 
                    specify feature definer in dependencies.
+delfunctions : unloadpre                               *frawor-f-delfunctions*
+        Defined in plugin/frawor/functions plugin. Deletes all non-anonymous 
+        functions in s:F._functions dictionary before plugin is unloaded. Note 
+        that you should not unload plugin/frawor/functions because it is 
+        required for other plugins to be unloaded correctly.
+                                                    *frawor-f-addextfunctions*
+addextfunctions : function ({ {funcname}: {funcdescr} })
+        Defined in plugin/frawor/functions plugin. Adds external functions and 
+        puts them into s:F._functions. If plugin that calls this feature is not 
+        yet loaded, |FuncUndefined| events will be created instead of functions. 
+        {funcname} must be a valid function name (names that start with s: are 
+        also supported, though it is probably better to just use `let 
+        s:F._functions['s:Func']=function('s:Func')' after each plugin-local 
+        function definition). This feature will throw an error if function is 
+        already defined and there is no way to avoid that, so do not create 
+        functions that can unload your plugin with this feature.
 
 ==============================================================================
 5. Type definitions                                             *frawor-types*
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.