Semantic mode provides a number of commands for navigating, querying, and editing source code in a language-aware manner. These commands generally act on tags, which are the source-code units deemed “important” by the present programming language (e.g., functions in the C programming language).
These commands may be used in any buffer that has been parsed by Semantic. Several of them prompt for a tag name using the minibuffer; here, the TAB key can be used to complete tag names. Others act on the current tag, meaning the tag at (or around) point.
Prompt for a tag defined in the current file, and move point to it
(semantic-complete-jump-local
).
Prompt for a tag defined in any file that Emacs has parsed, and move
point to it (semantic-complete-jump
).
Display a list of the possible completions of the current tag
(semantic-analyze-possible-completions
).
Prompt for a tag, and display a list of tags that call it
(semantic-symref-symbol
). This relies on the presence of an
external symbol reference tool. See Symbol References.
Display a list of tags that call the current tag
(semantic-symref
). This relies on the presence of an external
symbol reference tool. See Symbol References.
Move point to the previous tag (senator-previous-tag
).
Move point to the next tag (senator-next-tag
).
Move point “up” one reference (senator-go-to-up-reference
).
The meaning of “up” is language-dependent; in C++, for instance,
this means moving to the parent of the current tag.
Display a list of possible completions for the symbol at point
(semantic-complete-analyze-inline
). This also activates a
special set of key bindings for choosing a completion: RET
accepts the current completion, M-n and M-p cycle through
possible completions, TAB completes as far as possible and then
cycles, and C-g or any other key aborts the completion.
See Smart Completion.
Kill the current tag (senator-kill-tag
). This removes the text
for that tag, placing it in the kill ring. You can retrieve the text
with C-y. This also places the tag in the tag ring, so
that you can yank it with \C-c,\C-y, below.
Copy the current tag into the kill ring as well as the tag ring
(senator-copy-tag
).
Yank a tag from the tag ring (senator-yank-tag
).
Copy the current tag into a register
(senator-copy-tag-to-register
). With an optional argument,
kill it as well. This allows you to insert or jump to that tag with
the usual register commands. See Registers in Emacs manual.
Transpose the current tag with the previous one
(senator-transpose-tags-up
).
Transpose the current tag with the next one
(senator-transpose-tags-down
).