Hello,
I am writing documentation for a package. I use org mode. I would like to make this process a bit easier. So this is what I am thinking of:
(1) In a source file, I have a buffer-local variable pointing to the documentation file (of org type).
Above def statements like (2) (defXYZ foo ...)
I have a comment line like this: (3) ;; user-interface (or ;; internal-functionality, or other)
Then, executing the elisp function `goto-user-doc' in the def's body would combine the information on documentation file (1), type of documentation (3), and the `def' statement.
It would take me to the documentation file, and position at the location of `foo'.
With a prefix, the function would create the skeleton documentation for `foo'
I am looking for slime's functionality to parse the `def' statement. It would be nice to obtain the lambda form as well. Where in the code should I look?
Or, maybe there is an existing elisp package that does that?
Thanks,
Mirko
On Thu, Nov 22 2012, Mirko Vukovic wrote:
[...]
I am looking for slime's functionality to parse the `def' statement. It would be nice to obtain the lambda form as well. Where in the code should I look?
SLIME does very little parsing of this kind. slime-defun-at-point or slime-symbol-at-point is as sophisticated as it gets.
Or, maybe there is an existing elisp package that does that?
If you have the source of your definition as string you can pass it to the Emacs Lisp read function. That works quite well, as long as you don't use Common Lisp specific reader macros. The functions down-list/ forward-list/up-list are also quite useful to parse Lisp code.
Helmut