Next: , Up: Using Semantic

2.1 Semantic mode

Semantic mode is a global minor mode for Semantic as a whole. When enabled, each file you visit is automatically parsed, provided its major mode is specified in the variable semantic-new-buffer-setup-functions (the default value of this variable sets up parsing for all the parsers included with Emacs, but you may add to it if you install additional parsers).

In each parser-enabled buffer, a number of Semantic commands are available for navigating, querying, and editing source code. See Semantic mode user commands. Enabling Semantic mode also installs a ‘Development’ menu on the menu-bar, with many of these commands.

In addition, enabling Semantic mode turns on certain auxiliary global minor modes. The variable semantic-default-submodes determines which auxiliary modes are enabled; the defaults are SemanticDB mode (see SemanticDB) and Global Semantic Idle Scheduler mode (see Idle Scheduler). You can also toggle the auxiliary minor modes separately, using their mode functions (e.g., M-x semanticdb-minor-mode), or via the ‘Development’ menu. The various auxiliary minor modes are described in the following sections.

— Variable: semantic-new-buffer-setup-functions

The value of this variable is an alist of functions to call for setting up Semantic parsing in the buffer. Each element has the form (mode . fn), where mode is a value of major-mode for the buffer and fn is the corresponding function for setting up the parser. fn is called, with no arguments, after the major mode is initialized (and after the mode hooks have been run).

The default value enables Semantic for all supported major modes (i.e., C, C++, Scheme, Javascript, Java, HTML, SRecode, and Make), but you can remove modes from this list if you don't want to use Semantic with them.

— Variable: semantic-default-submodes

The value of this variable is a list of symbols, specifying the auxiliary minor modes to enable when enabling Semantic mode. The valid mode symbols are: