I have a macro called "col_list_from_table_def()" all it really does is perform some regex magic on a specifically formatted file and return a string. This functions properly and is for this question unimportant.
However, from a second macro called sel_table(tableName) I want to open a file, execute that macro, close the file and insert the results in the buffer where I was to start with.
_command sel_table(tableName)
{
edit_file_in_project(tableName);
cols = col_list_from_table_def();
quit_file()
_insert_text(cols);
}
I have tried several iterations on this code, but all end up badly. Either it writes the text to some other buffer that is also open, but different from the one that was active when it was called. Or it seems to dupe the buffer window when it is done, as if it opened the tableFile in a window and when it quits, it opens the original file in the same window instead of dismissing it.
I am certain I am just doing something stupid, anyone have a clue how to fix this?