Thanks for pointing out the error. I've updated my code to no error
if comment-start-skip is not defined.
You can test just the doc finding bit with:
M-x semantic-ia-show-doc RET
Storing the doc string in the parser is one good way to get the info
you want. If managing the doc ends up being a huge memory sink, you
instead can override semantic-documentation-for-tag. See
bovine/semantic-el.el version of an override as an example. The Emacs
Lisp parser has both options (in tag, or search for tag) for looking up
doc. By default storing the text is off just because of how big the
You could also store a location (ie - character 20304) for the string
to use in your override. I hadn't tried this so it may require some
experimentation in the core to get that path working.
Does that help?
Did you get papers signed for the FSF for your contributions to CEDET
and Emacs? I know they are still interested in your Python support.
On 05/01/2010 06:21 PM, emacs18@... wrote:
> Hi Eric,
> Finally I found some time to look into adding better python support.
> As you suggested I started with semantic-test-all-format-tag-functions
> and tried to figure out why it was failing. The first item I ran into
> was lack of doc-string support. So I made the following change.
> Before I spend more time on this, I thought I should bound this off of
> the list to see if I'm on the right track. I test this by executing
> the following code with the cursor within a python function.
> (let ((tag (semantic-current-tag)))
> (semantic-tag-docstring tag))
> It returned the properly doc-string.
> Does this look reasonable?
> Was this done already?
> Index: wisent-python.wy
> RCS file: /cvsroot/cedet/cedet/semantic/wisent/wisent-python.wy,v
> retrieving revision 1.39
> diff -u -r1.39 wisent-python.wy
> --- wisent-python.wy 26 Mar 2010 22:18:06 -0000 1.39
> +++ wisent-python.wy 1 May 2010 22:11:07 -0000
> @@ -710,10 +710,22 @@
> ;;;@@ funcdef
> -;; funcdef: 'def' NAME parameters ':' suite
> +;; Function Definition, e.g.,
> +;; def f(a, b, *args, **kw):
> +;; 'This is the doc string'
> +;; statement
> +;; ...
> +;; The doc-string of a function is the first item following the colon
> +;; if it is a string.
> : DEF NAME function_parameter_list COLON suite
> - (FUNCTION-TAG $2 nil $3)
> + (let ((doc (car (car $5))))
> + (if (and doc (stringp doc) (or (eq (aref doc 0) ?\') (eq (aref doc 0) ?\")))
> + (FUNCTION-TAG $2 nil $3 :documentation doc)
> + (FUNCTION-TAG $2 nil $3)))
> Cedet-devel mailing list