|
From: | Eric Ludlam |
Subject: | Re: Per-language project-search-path, was: Re: Unified project interface |
Date: | Mon, 03 Aug 2015 07:33:35 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 |
On 08/02/2015 07:39 PM, Michael Heerdegen wrote:
Eric Ludlam <address@hidden> writes:It may be that the specifics you are looking for are part of the local context parser, which includes functions such as -get-local-variables, -get-local-arguments, and -current-symbol, which gets the whole symbols in a dotted expression. This is in semantic/ctxt.el.Thanks for the explanations. I gave these functions a quick try, evaluating them via M-: (the-function), with not much luck. In Elisp, all calls always returned nil. In a C file, I even got an error: Debugger entered--Lisp error: (wrong-type-argument syntax-table-p nil) set-syntax-table(nil) (progn (set-syntax-table semantic-lex-syntax-table) (save-excursion (cond ((looking-at "\\w\\|\\s_") because semantic-lex-syntax-table is bound to nil which `set-syntax-table' doesn't like.
Everything in the semantic system needs `semantic-mode' enabled. That sets up all the parsing context needed for the various tools, and keeps it up to date. There is a lot of little features needed to handle parsing, so the mode enables the hooks to get it setup as you load files, and then the tagging parser parsers you buffers, which the context parser uses to identify the outer bounds of different contexts.
Once you do that, you could try 'semantic-analyze-current-context' which will give you some high level data about where point is. The local -ctxt- functions can be used to do something unrelated smart completion.
Eric
[Prev in Thread] | Current Thread | [Next in Thread] |