INSTALLING THE NEDIT EXPANDER ============================= 1. Create a directory on which to install the expander files 2. unpack the tar file expander.tar in this directory using the command $ tar xvf expander.tar You will then find the following files: - expander.hlp A short explanation of expander features - expander.c the expander source file - Makefile an example make file using the gnu compiler - dot_nedit macro definitions to add to your .nedit file. 3. Update the dot_nedit file so it uses your install-directory instead of "/home/umv/nedit/expander" 4. Build the expander program. Update the Makefile to use your own compiler and then type 'make'. 4. All users wanting to use the expander, will have to incorporate the macro definitions of 'umv_expand' and 'umv_next' into their private .nedit files. Simply include the updated dot_nedit file into the .nedit file. UPDATING THE EXPANDER KEYWORDS ============================== You will have to change and rebuild the 'expander.c' program. The code is reasonably straightforward, but eg to add the "whoppy" keyword, you should: 1. Add the keyword to the keyword_table by specifying a keyword string and a keyword expansion function. The NULLs entry should remain the last line! keyword_table[] = { { "if" ,expand_if } ,{ "else" ,expand_else } ,{ "for" ,expand_for } ,{ "while" ,expand_while } ,{ "switch" ,expand_switch } ,{ "case" ,expand_case } ,{ "whoppy" ,expand_whoppy } /* MY NEW KEYWORD */ ,{ "default" ,expand_default } ,{ "enum" ,expand_enum } /* typedef enum */ ,{ "struct" ,expand_struct } /* typedef struct */ ,{ "head" ,expand_funchead } /* function header */ ,{ "function" ,expand_function } /* function template */ ,{ "{" ,expand_block } /* block */ ,{ "#include" ,expand_include } /* #include */ ,{ "cb" ,expand_cb } /* multi-line comment block */ ,{ NULL ,NULL } /* MUST BE THE LAST!! */ }; 2. Add the function to the forward reference list: void expand_if (int indent); void expand_else (int indent); void expand_for (int indent); void expand_while (int indent); void expand_switch (int indent); void expand_case (int indent); void expand_whoppy (int indent); /* MY NEW EXPANSION FUNCTION */ void expand_default (int indent); void expand_enum (int indent); void expand_struct (int indent); void expand_funchead (int indent); void expand_function (int indent); void expand_block (int indent); void expand_include (int indent); void expand_cb (int indent); 3. At the end of the file, add the actual expansion function (expand_whoppy), using an existing expansion function as an example.