Next: , Previous: Add-on ECB-windows, Up: Add-on ECB-windows

4.2.1 Displaying the current semantic context via analyser

The CEDET-suite contains the semantic analyzer1 which is a library tool that performs context analysis and can derive useful information.

Please see the related node in the info-manual of cedet/semantic for more detailed informations about this tool and how to setup it for best performance for your project needs.

The semantic-analyzer output can be used through a special ECB-window. This interface lists details about the analysis, such as the current function, local arguments and variables, details on the prefix (the symbol the cursor is on), and a list of all possible completions (see semantic-analyze-possible-completions for more details about completions available via the semantic-analyser).

The analyser-ECB-window is of type tree-buffer. See Tree-buffer basics for basic informations how to use such a tree-buffer. Usage of the analyser-ECB-window Synchronizing the analyse-window

Per default the content of the analyser-ECB-window is automatically synchronized and updated with current point of the current source-buffer in the edit-area (see ecb-analyse-buffer-sync and most notably ecb-analyse-buffer-sync-delay) and ECB-window synchronizing).

In contrary to the sync-options of the basic ECB-windows2 the default synchronisation delay of the ECB-analyse-window is quite high: 2 seconds (see ecb-analyse-buffer-sync).

What is the reason for this: a small value like 0.25 as for the basic windows would make the analyse-window quite unusable because then more or less after each type (depends on how fast you are typing) the analyse window would be synchronized with current point, which can be really annoying when there would be hundreds of completions for the current point.

Imagine the following scenario: programming in emacs-lisp, typing


and then you make a short break, just a moment, but immediately ECB would call the semantic-analyzer to analyse the current context for possible completions (a.o.). You can imagine that there are even thousands of possible function completions in emacs-lisp which beginns with “e”. Getting all these and displaying them in the analyse-window can take some time! Of course the whole stuff is interruptable by any key-press so ECB will not be blocked but nevertheless the will be a noticeable break in your typing.

Therefore it is strongly recommended to choose one of the following possibilities: Interactive commands of the analyser-ECB-window

ECB offers the following commands for the analyser-ECB-window:

See Interactive ECB commands for details about these commands. Activating/Displaying the analyser-ECB-window

Either use one of the predefined layouts "left-analyse" or “leftright-analyse” (e.g. via C-c . l c) or create a new ecb-layout via the command ecb-create-new-layout and add a buffer of type “other” and name “analyse” into this new layout (see Creating a new ECB-layout). Customizing the analyser ECB-window

See ecb-analyse for a list of all options currently available for customizing this ECB-window to your needs.


[1] Note that ECB uses analyser (with s) whereas semantic uses analyzer (with z).

[2] see Basic ECB-windows and the options ecb-basic-buffer-sync and ecb-basic-buffer-sync-delay.