I finally got a few time to reply to your suggestion!
>>(defmacro define-lex-analyzer (name doc condition &rest forms)
>>(defsubst semantic-lex-analyzer-p (symbol)
>>(defun semantic-lex-analyzer-at-point ()
>>(defadvice describe-function (around semantic-help activate)
> Regarding these functions. This seems like a pretty logical path to
> take given our existing implementation. I just had a thought that
> might be interesting. Right now in `define-lex-analyzer', we mock
> up a setq. If we ALSO added this:
> (fest ',name `(lambda () ,doc (when ,condition ,@forms)))
> then the doc for function help is automatically provided, AND
> you could take your analyzer and do this:
> and it may or may not return a lexical token. It isn't clear if
> that particular features is useful or not except perhaps for testing
> and debugging one analyzer. The existing mechanism for building a
> lexer would continue to work as well since it would have the
> variable value.
I like that idea! It keeps the code very simple and, as you said, it
could be useful to get analyzers as true functions to help test and
Attached is a patch to semantic-lex.el.
I just added a dummy `defun' before the `fset' to get a link
to the file from which the definition was loaded.
The patch also includes some whitespace and doc fixes.
If you like it, I will check it in ;-)