1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
|
@ignore
@node Semantic Minor Modes
@chapter Semantic Mintor Modes
@end ignore
Semantic comes with a wide range of minor-modes which use various
features of semantic. These modes vary widly in utility.
There are some core modes that are required for smooth operations.
Some of these are discussed in other chapters, such as @ref{Idle
Scheduler}, and @ref{semanticdb}
@menu
* Code Helpers:: Modes for assisting in authoring code.
* Development Modes:: Modes for assisting in developing/debugging Semantic.
@end menu
@node Code Helpers
@section Code Helpers
Code Helpers are minor modes that augment basic Emacs behavior in ways
that can assist in programming Semantic supported langauges.
@menu
* Sticky Function Mode::
* Tag Decoration Mode::
* MRU Bookmarks Mode::
@end menu
Senator is another mode which can assist in programming @ref{senator}.
@node Development Modes
@section Development Modes
@menu
* Highlight Edits Mode::
* Parser State::
* Unmatched Syntax Highlighting::
* Sticky Function Mode::
* Tag Decoration Mode::
* MRU Bookmarks Mode::
@end menu
@node Sticky Function Mode
@subsection Sticky Function Headers
@deffn Command semantic-stickyfunc-mode &optional arg
Minor mode to show the title of a tag in the header line.
Enables/disables making the header line of functions sticky.
A function (or other tag class specified by
@code{semantic-stickyfunc-sticky-classes}) has a header line, meaning the
first line which describes the rest of the construct. This first
line is what is displayed in the Emacs @var{21} header line.
With prefix argument @var{ARG}, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-@code{nil} if the
minor mode is enabled.
@end deffn
@defvar semantic-stickyfunc-sticky-classes
List of tag classes which sticky func will display in the header line.
@end defvar
@node Tag Decoration Mode
@subsection Tag Decoration Mode
@cindex semantic-decoration-mode
Decoration mode is a harness that allows any parsed tag to be
highlighted based on some arbitrary feature of that tag. Decoration
mode is actually a full harness for providing any kind of decoration
on a tag based on a prefix function.
@deffn Command semantic-decoration-mode &optional arg
@anchor{semantic-decoration-mode}
Minor mode for decorating tags.
Decorations are specified in @code{semantic-decoration-styles}.
You can define new decoration styles with
@dfn{define-semantic-decoration-style}.
With prefix argument @var{arg}, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-@code{nil} if the
minor mode is enabled.
@end deffn
To enable or disable specific decorations, you can use this function:
@deffn Command semantic-toggle-decoration-style name &optional arg
@anchor{semantic-toggle-decoration-style}
Turn on/off the decoration style with @var{name}.
Decorations are specified in @code{semantic-decoration-styles}.
With prefix argument @var{arg}, turn on if positive, otherwise off.
Return non-@code{nil} if the decoration style is enabled.
@end deffn
You can create new types of decorations using the following function:
@defun define-semantic-decoration-style name doc &rest flags
@anchor{define-semantic-decoration-style}
Define a new decoration style with @var{name}.
@var{doc} is a documentation string describing the decoration style @var{name}.
It is appended to auto-generated doc strings.
An Optional list of @var{flags} can also be specified. Flags are:
@code{:enabled} <value> - specify the default enabled value for @var{name}.
This defines two new overload functions respectively called @code{NAME-p}
and @code{NAME-highlight}, for which you must provide a default
implementation in respectively the functions @code{NAME-p-default} and
@code{NAME-highlight-default}. Those functions are passed a tag. @code{NAME-p}
must return non-@code{nil} to indicate that the tag should be decorated by
@code{NAME-highlight}.
To put primary decorations on a tag @code{NAME-highlight} must use
functions like @dfn{semantic-set-tag-face}, @dfn{semantic-set-tag-intangible},
etc., found in the semantic-decorate library.
To add other kind of decorations on a tag, @code{NAME-highlight} must use
@dfn{semantic-decorate-tag}, and other functions of the semantic
decoration @var{api} found in this library.
@end defun
@node MRU Bookmarks Mode
@subsection MRU Bookmarks Mode
@cindex semantic-mru-bookmark-mode
MRU stands for Most Recently Used. Semantic MRU Bookmarks track the
tags you edit and maintain a ring of things you've been working on.
You can then switch back to tags you've worked on recently by name.
@deffn Command semantic-mru-bookmark-mode &optional arg
@anchor{semantic-mru-bookmark-mode}
Minor mode for tracking tag-based bookmarks automatically.
Tag based bookmarks a tracked based on editing and viewing habits
and can then be navigated via the @var{mru} bookmark keymap.
With prefix argument @var{arg}, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-@code{nil} if the
minor mode is enabled.
@end deffn
Once this mode is enbled, any edit, or mark setting will add the
current tag to your MRU bookmark ring.
@table @kbd
@item C-x B
This keysequence is like @code{switch-to-buffer}, but uses a capital
@kbd{B} instead of lower case. This lets you type in a tag name, or
use @kbd{M-p} and @kbd{M-n} to cycle through the bookmark list in
MRU order.
@end table
@node Highlight Edits Mode
@subsection Highlight Edits Mode
Highlight edits mode is useful mostly for debugging the incremental
parser. As you change text, that effected text is highlighted, and
you can visual predict what actions the incremental parser will need
to make.
@deffn Command semantic-highlight-edits-mode &optional arg
Minor mode for highlighting changes made in a buffer.
Changes are tracked by semantic so that the incremental parser can work
properly.
With prefix argument @var{ARG}, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-@code{nil} if the
minor mode is enabled.
@end deffn
@deffn Face semantic-highlight-edits-face
Face used to show dirty tokens in @code{semantic-highlight-edits-mode}.
@end deffn
@node Parser State
@subsection Parser State
@deffn Command semantic-show-parser-state-mode &optional arg
Minor mode for displaying parser cache state in the modeline.
The cache can be in one of three states. They are
Up to date, Partial reprase needed, and Full reparse needed.
The state is indicated in the modeline with the following characters:
@table @code
@item -
The cache is up to date.
@item !
The cache requires a full update.
@item ~
The cache needs to be incrementally parsed.
@item %
The buffer is not lexically parseable.
@item @@
Auto-parse in progress (not set here.)
@end table
With prefix argument @var{ARG}, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-@code{nil} if the
minor mode is enabled.
@end deffn
@node Unmatched Syntax Highlighting
@subsection Unmatched Syntax Highlighting
@deffn Command semantic-show-unmatched-syntax-mode &optional arg
Minor mode to highlight unmatched syntax tokens.
When a parser executes, some elements in the buffer may not match any
parser rules. These text characters are considered unmatched syntax.
Often time, the display of unmatched syntax can expose coding
problems before the compiler is run.
With prefix argument @var{ARG}, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-@code{nil} if the
minor mode is enabled.
@kbd{C-c , `} @dfn{semantic-show-unmatched-syntax-next}
@end deffn
@deffn Option semantic-unmatched-syntax-face
Face used to show unmatched-syntax in.
The face is used in @dfn{semantic-show-unmatched-syntax-mode}.
@end deffn
|