Hello,
I would like to develop a method to name tables based on their position in the
heading hierarchy. This is the proposed algorithm (if if deserves such a
dignity!):
1. Manually insert tables as required, label tables by '#+tblname:'
2. Search forward for #+tblname: leaves point before ':'.
3. Move point forward by one char using =forward-char=.
4. Insert a space using =insert=.
5. Find the heading hierarchy up to the nearest level 1 heading in
which point lies. (How?).
6. Concatenate the heading names into a string with a separator
(perhaps '_').
7. Insert this string at point. This is the table name.
If anyone has already done something like this, please point me to the code. I
welcome comments on the proposed 'algorithm' and any hnts on how to implement it
will also be very welcome. I have not written any emacs-lisp in a long time
and am
revisiting the elisp intro manual.
The aim is to use the tables to create a SQLite database, either on
disk or in memory, then use the DB to generate input files for other
programs.
Many thanks,
Roger