"Fossies" - the Fresh Open Source Software Archive

Member "emacs-26.1/doc/misc/sem-user.texi" (23 Apr 2018, 50701 Bytes) of package /linux/misc/emacs-26.1.tar.xz:

As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "sem-user.texi": 25.3_vs_26.1.

    1 @c This is part of the Semantic manual.
    2 @c Copyright (C) 1999-2005, 2007, 2009-2018 Free Software Foundation,
    3 @c Inc.
    4 @c See file semantic.texi for copying conditions.
    6 You can begin using @semantic{} by enabling Semantic mode, a global
    7 minor mode: type @kbd{M-x semantic-mode}, or open the @samp{Tools}
    8 menu and click on the menu item named @samp{Source Code Parsers
    9 (Semantic)}.  @xref{Semantic mode}.
   11 When Semantic mode is turned on, Emacs automatically parses each file
   12 you visit.  You can then use @semantic{} user commands in those
   13 buffers (@pxref{Semantic mode user commands}).  You can also choose to
   14 enable a number of ``helper'' minor modes for saving tags, displaying
   15 tag information, and so forth.
   17 To enable Semantic mode each time you start Emacs, add the line
   18 @code{(semantic-mode 1)} to your initialization file.  @xref{Init
   19 File,,,emacs,Emacs manual}.
   21 @menu
   22 * Semantic mode::       Global minor mode for @semantic{}.
   23 * SemanticDB::          Caching parsed buffers between sessions.
   24 * Idle Scheduler::      @semantic{} actions that occur when idle.
   25 * Analyzer::            Semantic tools for analyzing code.
   26 * Speedbar::            Using @semantic{} with the Speedbar.
   27 * SymRef::              Interface to symbol reference tools.
   28 * MRU Bookmarks::       Managing tag "bookmarks".
   29 * Sticky Func Mode::    Showing declarations in the header line.
   30 * Highlight Func Mode:: Highlight the current function declaration.
   31 * Tag Decoration Mode:: Minor mode to decorate tags.
   32 @end menu
   34 @node Semantic mode
   35 @section Semantic mode
   36 @cindex Semantic mode
   38 Semantic mode is a global minor mode for @semantic{} as a whole.  When
   39 enabled, each file you visit is automatically parsed, provided its
   40 major mode is specified in the variable
   41 @code{semantic-new-buffer-setup-functions} (the default value of this
   42 variable sets up parsing for all the parsers included with Emacs, but
   43 you may add to it if you install additional parsers).
   45 In each parser-enabled buffer, a number of @semantic{} commands are
   46 available for navigating, querying, and editing source code.
   47 @xref{Semantic mode user commands}.  Enabling Semantic mode also
   48 installs a @samp{Development} menu on the menu-bar, with many of these
   49 commands.
   51 In addition, enabling Semantic mode turns on certain auxiliary global
   52 minor modes.  The variable @code{semantic-default-submodes} determines
   53 which auxiliary modes are enabled; the defaults are SemanticDB mode
   54 (@pxref{SemanticDB}) and Global Semantic Idle Scheduler mode
   55 (@pxref{Idle Scheduler}).  You can also toggle the auxiliary minor
   56 modes separately, using their mode functions (e.g., @kbd{M-x
   57 semanticdb-minor-mode}), or via the @samp{Development} menu.  The
   58 various auxiliary minor modes are described in the following sections.
   60 @defvar semantic-new-buffer-setup-functions
   61 The value of this variable is an alist of functions to call for
   62 setting up @semantic{} parsing in the buffer.  Each element has the
   63 form @code{(@var{mode} . @var{fn})}, where @var{mode} is a value of
   64 @code{major-mode} for the buffer and @var{fn} is the corresponding
   65 function for setting up the parser.  @var{fn} is called, with no
   66 arguments, after the major mode is initialized (and after the mode
   67 hooks have been run).
   69 The default value enables @semantic{} for all supported major modes
   70 (i.e., C, C++, Scheme, Javascript, Java, HTML, SRecode, and Make), but
   71 you can remove modes from this list if you don't want to use
   72 @semantic{} with them.
   73 @end defvar
   75 @defvar semantic-default-submodes
   76 The value of this variable is a list of symbols, specifying the
   77 auxiliary minor modes to enable when enabling Semantic mode.  The
   78 valid mode symbols are:
   80 @itemize
   81 @item @code{global-semantic-idle-scheduler-mode} (@pxref{Idle Scheduler}).
   82 @item @code{global-semanticdb-minor-mode} (@pxref{SemanticDB}).
   83 @item @code{global-semantic-idle-summary-mode} (@pxref{Idle Summary Mode}).
   84 @item @code{global-semantic-idle-completions-mode} (@pxref{Idle Completions Mode}).
   85 @item @code{global-semantic-highlight-func-mode} (@pxref{Highlight Func Mode}).
   86 @item @code{global-semantic-decoration-mode} (@pxref{Tag Decoration Mode}).
   87 @item @code{global-semantic-stickyfunc-mode} (@pxref{Sticky Func Mode}).
   88 @item @code{global-semantic-mru-bookmark-mode} (@pxref{MRU Bookmarks}).
   89 @end itemize
   90 @end defvar
   92 @menu
   93 * Semantic mode user commands::
   94 @end menu
   96 @node Semantic mode user commands
   97 @subsection Semantic mode user commands
   99 Semantic mode provides a number of commands for navigating, querying,
  100 and editing source code in a language-aware manner.  These commands
  101 generally act on @dfn{tags}, which are the source-code units deemed
  102 ``important'' by the present programming language (e.g., functions in
  103 the C programming language).
  105 These commands may be used in any buffer that has been parsed by
  106 @semantic{}.  Several of them prompt for a tag name using the
  107 minibuffer; here, the @kbd{TAB} key can be used to complete tag names.
  108 Others act on the @dfn{current tag}, meaning the tag at (or around)
  109 point.
  111 @table @kbd
  112 @item C-c , j
  113 Prompt for a tag defined in the current file, and move point to it
  114 (@code{semantic-complete-jump-local}).
  116 @item C-c , J
  117 Prompt for a tag defined in any file that Emacs has parsed, and move
  118 point to it (@code{semantic-complete-jump}).
  120 @item C-c , l
  121 Display a list of the possible completions of the current tag
  122 (@code{semantic-analyze-possible-completions}).
  124 @item C-c , g
  125 Prompt for a tag, and display a list of tags that call it
  126 (@code{semantic-symref-symbol}).  This relies on the presence of an
  127 external symbol reference tool.  @xref{SymRef}.
  129 @item C-c , G
  130 Display a list of tags that call the current tag
  131 (@code{semantic-symref}).  This relies on the presence of an external
  132 symbol reference tool.  @xref{SymRef}.
  134 @item C-c , p
  135 Move point to the previous tag (@code{senator-previous-tag}).
  137 @item C-c , n
  138 Move point to the next tag (@code{senator-next-tag}).
  140 @item C-c , u
  141 Move point ``up'' one reference (@code{senator-go-to-up-reference}).
  142 The meaning of ``up'' is language-dependent; in C++, for instance,
  143 this means moving to the parent of the current tag.
  145 @item C-c, @key{SPC}
  146 Display a list of possible completions for the symbol at point
  147 (@code{semantic-complete-analyze-inline}).  This also activates a
  148 special set of keybindings for choosing a completion: @key{RET}
  149 accepts the current completion, @kbd{M-n} and @kbd{M-p} cycle through
  150 possible completions, @key{TAB} completes as far as possible and then
  151 cycles, and @kbd{C-g} or any other key aborts the completion.
  152 @xref{Smart Completion}.
  154 @item C-c , C-w
  155 Kill the current tag (@code{senator-kill-tag}).  This removes the text
  156 for that tag, placing it in the kill ring.  You can retrieve the text
  157 with @kbd{C-y}.  This also places the tag in the @dfn{tag ring}, so
  158 that you can yank it with @kbd{\C-c,\C-y}, below.
  160 @item C-c , M-w
  161 Copy the current tag into the kill ring as well as the tag ring
  162 (@code{senator-copy-tag}).
  164 @item C-c , C-y
  165 Yank a tag from the tag ring (@code{senator-yank-tag}).
  167 @item C-c , r
  168 Copy the current tag into a register
  169 (@code{senator-copy-tag-to-register}).  With an optional argument,
  170 kill it as well.  This allows you to insert or jump to that tag with
  171 the usual register commands.  @xref{Registers,,,emacs,Emacs manual}.
  173 @item C-c , @kbd{up}
  174 Transpose the current tag with the previous one
  175 (@code{senator-transpose-tags-up}).
  177 @item C-c , @kbd{down}
  178 Transpose the current tag with the next one
  179 (@code{senator-transpose-tags-down}).
  180 @end table
  182 @node SemanticDB
  183 @section Semantic Database
  184 @cindex SemanticDB
  186 The Semantic Database (SemanticDB) caches the results of parsing
  187 source code files.  This data can be saved to disk when you exit
  188 Emacs, and reloaded automatically when you subsequently revisit the
  189 same source code files.  This saves time by eliminating the need to
  190 re-parse unmodified files.
  192 SemanticDB also provides an @acronym{API} that programs can use to
  193 acquire information about source code tags.  This information can be
  194 accessed without loading the original the source files into memory.
  195 It can also be used to create alternate ``back-ends'' for storing tag
  196 information in alternative on-disk formats.
  198 By default, SemanticDB is enabled together with Semantic mode.  To
  199 disable it, remove it from @code{semantic-default-submodes}
  200 (@pxref{Semantic mode}).  You can also enable or disable SemanticDB
  201 with @kbd{M-x global-semanticdb-minor-mode}.
  203 @deffn Command global-semanticdb-minor-mode
  204 Toggle SemanticDB mode.  When enabled, any source code parsed by
  205 @semantic{} is cached in a database.
  206 @end deffn
  208 SemanticDB offers a large number of customizable options, which are
  209 described in the following subsections.
  211 @menu
  212 * Semanticdb Tag Storage::
  213 * Semanticdb Search Configuration::
  214 * Changing Backends::
  215 * Create System Databases::
  216 @end menu
  218 @node Semanticdb Tag Storage
  219 @subsection Semanticdb Tag Storage
  221 Each time you exit Emacs, any data cached by SemanticDB is saved in
  222 the directory @file{.emacs.d/semanticdb/}, located in your home
  223 directory.  Within this directory, the cache data is written into a
  224 set of files according to a SemanticDB-specific filename convention.
  225 If the SemanticDB directory does not exist, Emacs first asks if you
  226 want to create it.
  228 You can change the name of the SemanticDB directory by customizing the
  229 variable @code{semanticdb-default-save-directory}.
  231 @deffn Option semanticdb-default-save-directory
  232 The name of the directory where SemanticDB cache files are saved.  If
  233 the value is @code{nil}, SemanticDB saves its data into a single file,
  234 in the current directory, whose filename is given by
  235 @code{semanticdb-default-file-name}.
  236 @end deffn
  238 @deffn Option semanticdb-default-file-name
  239 The name of a cache file in which to save SemanticDB, when
  240 @code{semanticdb-default-save-directory} is @code{nil}.
  241 @end deffn
  243 You can force SemanticDB to save the data from only certain files, or
  244 suppress saving altogether, by customizing
  245 @code{semanticdb-persistent-path}:
  247 @deffn Option semanticdb-persistent-path
  248 List of valid paths for SemanticDB to cache.  Each element should be a
  249 directory name (a string); then the parse data from any file in that
  250 directory is saved.
  252 As a special exception, the value of this variable can be a list
  253 containing a single symbol: @code{never}, @code{always}, or
  254 @code{project}.  The symbol @code{never} disables saving anywhere;
  255 @code{always} enables saving everywhere; and @code{project} enables
  256 saving directory based on the variable
  257 @code{semanticdb-project-predicate-functions}.
  259 The default value is @code{(always)}.
  260 @end deffn
  262 @defvar semanticdb-project-predicate-functions
  263 The value of this variable is a list of predicates for indicating that
  264 a directory belongs to a project.  This list is used when the value of
  265 @code{semanticdb-persistent-path} is @code{(project)}.  If the list is
  266 empty, all paths are considered valid.
  268 Project management packages, such as EDE (@pxref{Top,,,ede,EDE
  269 manual}), may add their own predicates with @dfn{add-hook} to this
  270 variable.  This allows SemanticDB to save tag caches in directories
  271 controlled by them.
  272 @end defvar
  274 @deffn Option semanticdb-save-database-functions
  275 Abnormal hook run after a database is saved.  Each function is called
  276 with one argument, the object representing the database recently
  277 written.
  278 @end deffn
  280 @node Semanticdb Search Configuration
  281 @subsection Semanticdb Search Configuration
  283   When another part of @semantic{} (or another Emacs package using
  284 @semantic{}) queries the SemanticDB library for a source code tag, the
  285 search need not be limited to tags defined within the current file.
  286 It can include tags defined elsewhere, such as @dfn{header files}
  287 referenced by the current file (e.g., via the C/C++ @code{#include}
  288 directive).  While performing the search, the SemanticDB library may
  289 even automatically visit other files and parse them, if necessary.
  291   The variable @code{semanticdb-find-default-throttle} determines how
  292 aggressively SemanticDB searches for source code tags.  @xref{Search
  293 Throttle}.
  295   The details of SemanticDB searches can vary from language to
  296 language.  In C/C++ code, for example, SemanticDB distinguishes
  297 between @dfn{project header files} and @dfn{system header files},
  298 based on whether the @code{#include} directive uses the @code{""} or
  299 @code{<>} filename delimiter.  SemanticDB looks for system header in
  300 the @dfn{system include path} (@pxref{Include paths}).
  302 @menu
  303 * Search Throttle::     Controlling how semanticdb searches occur.
  304 * Semanticdb Roots::    Specifying the root of different projects.
  305 * Include paths::       Specifying the directories to search.
  306 * Semanticdb search debugging commands::
  307 @end menu
  309 @node Search Throttle
  310 @subsubsection SemanticDB Search Throttle
  312 The SemanticDB @dfn{search throttle} determines how aggressive
  313 SemanticDB searches are.  It is controlled by the variable
  314 @code{semanticdb-find-default-throttle}.  The default value of this
  315 variable aims for maximum accuracy, at the expense of search time.
  317 Other parts of the @semantic{} package, particularly the different
  318 language parsers, may change the value of
  319 @code{semanticdb-find-default-throttle}.  You can override its value,
  320 for a given major mode, like this:
  322 @example
  323 (setq-mode-local c-mode
  324                  semanticdb-find-default-throttle
  325                  '(project unloaded system recursive))
  326 @end example
  328 @defvar semanticdb-find-default-throttle
  329 The default throttle for @code{semanticdb-find} routines.
  330 The throttle controls how detailed the list of database
  331 tables is for a symbol lookup.  The value is a list with
  332 the following keys:
  334 @table @code
  335 @item file
  336 The file the search is being performed from.  This option is here for
  337 completeness only, and is assumed to always be on.
  338 @item local
  339 Tables from the same local directory are included.  This includes
  340 files directly referenced by a file name which might be in a different
  341 directory.
  342 @item project
  343 Tables from the same local project are included If @code{project} is
  344 specified, then @code{local} is assumed.
  345 @item unloaded
  346 If a table is not in memory, load it.  If it is not cached on disk
  347 either, get the source, parse it, and create the table.
  348 @item system
  349 Tables from system databases.  These are specifically tables
  350 from system header files, or language equivalent.
  351 @item recursive
  352 For include based searches, includes tables referenced by included
  353 files.
  354 @item omniscience
  355 Included system databases which are omniscience, or somehow know
  356 everything.  Omniscience databases are found in
  357 @code{semanticdb-project-system-databases}.  The Emacs Lisp system
  358 @var{db} is an omniscience database.
  359 @end table
  360 @end defvar
  362 @node Semanticdb Roots
  363 @subsubsection SemanticDB project roots
  365 The @code{project} setting in the SemanticDB search throttle
  366 (@pxref{Search Throttle}) tells SemanticDB to search within the
  367 current single code project.  For @semantic{}'s point of view,
  368 @dfn{projects} are determined by their top-level directories, or
  369 @dfn{project roots}; every subdirectory of a project root is
  370 considered part of the same project.
  372 If you use EDE for project management, it will set the project roots
  373 automatically.  @xref{Top,,,ede,EDE manual}.  You can also specify
  374 them yourself.
  376 @deffn Option semanticdb-project-roots
  377 The value of this variable is a list of directories (strings) that are
  378 project roots.  All subdirectories of a project root are considered
  379 part of the same project.  This variable can be overridden by
  380 @code{semanticdb-project-root-functions}.
  381 @end deffn
  383 @defvar semanticdb-project-root-functions
  384 The value of this variable is a list of functions to determine a given
  385 directory's project root.  These functions are called, one at a time,
  386 with one argument (the directory name), and must return either
  387 @code{nil}, a string (the project root), or a list of strings
  388 (multiple project roots, for complex systems).  The first
  389 non-@code{nil} return value, if any, is taken to be the project root,
  390 overriding @code{semanticdb-project-roots}.
  391 @end defvar
  393 @node Include paths
  394 @subsubsection Include Paths
  396 System include paths are standard locations to find source code tags,
  397 such as the @dfn{header files} in @file{/usr/include} and its
  398 subdirectories on Unix-like operating systems.
  400 You can add and remove system include paths using the following
  401 commands:
  403 @deffn Command semantic-add-system-include dir &optional mode
  404 Prompts for a directory, @var{dir}, and add it as a system include
  405 path for the current major mode.  When called non-interactively, the
  406 major mode can be specified with the @var{mode} argument.
  407 @end deffn
  409 @deffn Command semantic-remove-system-include dir &optional mode
  410 Prompt for a directory, @var{dir}, and remove it from the system
  411 include path for the current major mode (or @var{mode}).
  412 @end deffn
  414 @deffn Command semantic-customize-system-include-path &optional mode
  415 Customize the system include path for the current major mode (or
  416 @var{mode}).
  417 @end deffn
  419 @defvar semanticdb-implied-include-tags
  420 Include tags implied for all files of a given mode.  You can set this
  421 variable with @code{defvar-mode-local} for a particular mode so that
  422 any symbols that exist for all files for that mode are included.
  423 @end defvar
  425 @c @xref{Search Optimization}, for more information on include paths.
  427 @node Semanticdb search debugging commands
  428 @subsubsection Semanticdb search debugging commands
  430 You can use @kbd{M-x semanticdb-dump-all-table-summary} to see the
  431 list of databases that will be searched from a given buffer.  You can
  432 follow up with @kbd{M-x semanticdb-find-test-translate-path} to then
  433 make sure specific tables from the path are discovered correctly.
  434 Alternately, you can get a list of include files @semantic{}
  435 encountered, but could not find on disk using @kbd{M-x
  436 semanticdb-find-adebug-lost-includes}.
  438 @deffn Command semanticdb-dump-all-table-summary
  439 Dump a list of all databases in Emacs memory.
  440 @end deffn
  442 @deffn Command semanticdb-find-test-translate-path &optional arg
  443 Call and output results of @dfn{semanticdb-find-translate-path}.  In
  444 the displayed buffer, you can type @key{SPC} to expand items.  With
  445 @var{arg} non-@code{nil}, specify a @var{brutish} translation.
  446 @end deffn
  448 @deffn Command semanticdb-find-adebug-lost-includes
  449 Translate the current path, then display the lost includes.
  450 Examines the variable @code{semanticdb-find-lost-includes}.
  451 @end deffn
  453 Lastly, you can test an explicit search term using this command:
  455 @deffn Command semantic-adebug-searchdb regex
  456 Search the semanticdb for @var{regex} for the current buffer.
  457 Display the results as a debug list.
  458 @end deffn
  460 @node Changing Backends
  461 @subsection Changing Backends
  463 If you want to use some other form of backend, you can use this
  464 variable to choose which back end class to use for your general tag
  465 storage.
  467 The default is to save databases in flat files.  Alternatively, you
  468 could write a new database backend that stores tags into a database,
  469 or other storage system.
  471 @defvar semanticdb-new-database-class
  472 The default type of database created for new files.  This can be
  473 changed on a per file basis, so that some directories are saved using
  474 one mechanism, and some directories via a different mechanism.
  475 @end defvar
  477 @node Create System Databases
  478 @subsection Create System Databases
  480 If your supported language stores the system libraries in readily
  481 available parsable source code, you can pre-generate database files
  482 for them once, which will be used over and over for tools such as
  483 summary-mode, or the analyzer.
  485 @deffn Command semanticdb-create-ebrowse-database dir
  486 Create an Ebrowse database for directory @var{dir}.  The database file
  487 is stored in ~/.semanticdb, or whichever directory is specified by
  488 @code{semanticdb-default-system-save-directory}.
  489 @end deffn
  491 @node Idle Scheduler
  492 @section Idle Scheduler
  493 @cindex Idle Scheduler
  495 The @dfn{Semantic Idle Scheduler} is a part of @semantic{} that
  496 performs various operations while Emacs is waiting for user input
  497 (idle time).  Its primary job is to perform buffer parsing during idle
  498 time.  You can also use the Idle Scheduler to display function
  499 prototypes (@pxref{Idle Summary Mode}) or symbol completions
  500 (@pxref{Idle Completions Mode}).
  502 @deffn Command global-semantic-idle-scheduler-mode &optional arg
  503 This command toggles Semantic Idle Scheduler mode in every
  504 @semantic{}-enabled buffer.  This minor mode ensures that the buffer
  505 is automatically reparsed whenever Emacs is idle.  If there is
  506 additional idle time, it runs jobs scheduled by other parts of
  507 @semantic{}, such as Semantic Idle Summary mode (@pxref{Idle Summary
  508 Mode}) and Semantic Idle Completions mode (@pxref{Idle Completions
  509 Mode}).
  510 @end deffn
  512 @deffn Option semantic-idle-scheduler-idle-time
  513 The value of this variable is the amount of idle time, in seconds,
  514 before the Semantic idle scheduler activates.  The default is 1.
  515 @end deffn
  517 @deffn Option semantic-idle-scheduler-verbose-flag
  518 If this variable is non-@code{nil}, the idle scheduler prints verbose
  519 messages while running, which are useful for debugging.
  520 @end deffn
  522 @menu
  523 * Reparsing Options::          Reparsing the current buffer in idle time.
  524 * Idle Working Options::       Options for extra work done at idle time.
  525 * Debugging Idle Time Issues:: How to produce good bug reports.
  526 * Idle Summary Mode::          Display prototype of symbol under cursor.
  527 * Idle Completions Mode::      Smart completion pop-up help.
  528 @end menu
  530 @node Reparsing Options
  531 @subsection Reparsing Options
  533 When activated during idle time, the Semantic idle scheduler
  534 automatically reparses all buffers that need it.  Any arriving user
  535 input cancels this, returning Emacs to its normal editing behavior.
  537 @deffn Option semantic-idle-scheduler-max-buffer-size
  538 Maximum size in bytes of buffers automatically reparsed.  If this
  539 value is less than or equal to @var{0}, buffers are automatically
  540 reparsed regardless of their size.
  541 @end deffn
  543 @deffn Option semantic-idle-scheduler-no-working-message
  544 If non-@code{nil}, disable display of working messages while reparsing.
  545 @end deffn
  547 @deffn Option semantic-idle-scheduler-working-in-modeline-flag
  548 If non-@code{nil}, show working messages in the mode line.  Normally,
  549 re-parsing shows messages in the minibuffer; this moves the parse
  550 message to the modeline instead.
  551 @end deffn
  553 @defvar semantic-before-idle-scheduler-reparse-hook
  554 This normal hook is run just before the idle scheduler begins
  555 reparsing.  If any hook function throws an error, the value of this
  556 variable is reset to @code{nil}.  This hook is not protected from
  557 lexical errors.
  558 @end defvar
  560 @defvar semantic-after-idle-scheduler-reparse-hook
  562 This normal hook is run after the idle scheduler finishes reparsing.
  563 If any hook throws an error, this variable is reset to @code{nil}.
  564 This hook is not protected from lexical errors.
  565 @end defvar
  567 @node Idle Working Options
  568 @subsection Idle Working Options
  570 In addition to reparsing buffers, the Semantic idle scheduler performs
  571 additional operations, including the following:
  573 @itemize
  574 @item
  575 Creating the include path caches required for symbol lookup.
  576 @item
  577 Create data type caches.
  578 @item
  579 Saving SemanticDB caches to disk.
  580 @item
  581 Speculatively parsing the files in the same directory as the current
  582 buffer.
  583 @end itemize
  585 Because this extra work is quite time-consuming, it is only carried
  586 out after a longer idle delay.  The following features control how the
  587 idle work is performed.
  589 @deffn Option semantic-idle-scheduler-work-idle-time
  590 The value of this variable is the amount of idle time, in seconds,
  591 before commencing idle work.  The default is 60.
  592 @end deffn
  594 @deffn Option semantic-idle-work-parse-neighboring-files-flag
  595 If the value of this variable is non-@code{nil}, the Semantic idle
  596 scheduler uses idle work time to parse files in the same directory as
  597 the current buffer.  This improves the accuracy of tag searches and
  598 saves time when visiting those files later, at the cost of doing a lot
  599 of parsing.  The default is @code{t}.
  600 @end deffn
  602 @node Debugging Idle Time Issues
  603 @subsection Debugging Idle Time Issues
  605 If you see an error signaled during idle time, it could be an
  606 indication of a more serious issue elsewhere.  It is not enough to
  607 enable @code{debug-on-error}, because the idle scheduler inhibits the
  608 debugger.  Instead, use the following commands to debug the error:
  610 @deffn Command semantic-debug-idle-function
  611 Run the Semantic idle function with debugging turned on.
  612 @end deffn
  614 @deffn Command semantic-debug-idle-work-function
  615 Run the Semantic idle work function with debugging turned on.
  616 @end deffn
  618 @node Idle Summary Mode
  619 @subsection Idle Summary Mode
  621 Semantic Idle Summary mode is a minor mode that displays a short
  622 summary of the symbol at point, such as its function prototype, in the
  623 echo area.  Its functionality is similar to what ElDoc mode provides
  624 for Emacs Lisp (@pxref{Lisp Doc,,,emacs,Emacs manual}).
  626 @deffn global-semantic-idle-summary-mode &optional arg
  627 This command toggles Semantic Idle Summary mode in all
  628 @semantic{}-enabled buffers.  You can also toggle it via the
  629 @samp{Show Tag Summaries} menu item in the @samp{Development} menu.
  630 @end deffn
  632 When Semantic Idle Summary mode is active, a summary of the tag at
  633 point is displayed in the echo area.  This display takes place during
  634 the idle time, as given by @code{semantic-idle-scheduler-idle-time}
  635 (@pxref{Idle Scheduler}).
  637 You can override the method for getting the current tag to display by
  638 setting @code{idle-summary-current-symbol-info}.
  640 @deffn Option semantic-idle-summary-function
  641 The value of this variable should be a function to call to display tag
  642 information during idle time.  See the variable
  643 @code{semantic-format-tag-functions} for a list of useful functions.
  644 @end deffn
  646 @defvar semantic-idle-summary-out-of-context-faces
  647 The value of this variable is a list of font-lock faces indicating
  648 useless summary contexts.  These are generally faces used to highlight
  649 comments or strings.  Semantic Idle Summary mode does not display its
  650 usual summary if the text at point has one of these faces.
  651 @end defvar
  653 @node Idle Completions Mode
  654 @subsection Idle Completions Mode
  656 Semantic Idle Completions mode is a minor mode for performing
  657 @dfn{code completions} during idle time.  The completions are
  658 displayed inline, with keybindings that allow you to cycle through
  659 different alternatives.
  661 Semantic Idle Completions mode performs completion based on the
  662 Semantic Analyzer (@pxref{Analyzer}).
  664 @deffn global-semantic-idle-completions-mode &optional arg
  665 This command toggles Semantic Idle Completions mode in every
  666 @semantic{}-enabled buffer.  You can also toggle it via the @samp{Show
  667 Tag Completions} menu item in the @samp{Development} menu.
  668 @end deffn
  670 If the tag at point has at least one completion, Semantic Idle
  671 Completions mode displays that completion inline---i.e., as part of
  672 the buffer text (you can change the display method by customizing
  673 @code{semantic-complete-inline-analyzer-idle-displayor-class}, as
  674 described below).  The completed part is highlighted, to indicate that
  675 it is not yet properly inserted into the buffer.  The echo area shows
  676 the completion, and whether there are other possible completions, like
  677 this:
  679 @example
  680 besselj [1 of 6 matches]
  681 @end example
  683 @noindent
  684 While the completion is being displayed, the following keybindings
  685 take effect:
  687 @table @kbd
  688 @item @key{RET}
  689 @itemx C-m
  690 Accept the current completion (@code{semantic-complete-inline-done}),
  691 placing it in the buffer and moving point to the end of the completed
  692 tag.
  693 @item M-n
  694 Select the next possible completion
  695 (@code{semantic-complete-inline-down}).  The new completion is shown
  696 inline, replacing the old completion.
  697 @item M-p
  698 Select the previous possible completion
  699 (@code{semantic-complete-inline-up}).
  700 @item @key{TAB}
  701 @item C-i
  702 Accept as much of the completion as possible.  If no additional
  703 completion can be accepted without ambiguity, select the next possible
  704 completion (@code{semantic-complete-inline-TAB}).
  705 @item C-g
  706 Quit without completing (@code{semantic-complete-inline-quit}).
  707 @end table
  709 @noindent
  710 You can also exit inline completion by issuing any other Emacs
  711 command.  The completion text then disappears from the buffer.
  713 @deffn Command semantic-complete-analyze-inline-idle
  714 This is the command for performing inline code completion.  It is
  715 called by Semantic Idle Completions mode during idle time, but you can
  716 also call it yourself.  It returns immediately, leaving the buffer in
  717 a state for inline completion.
  718 @end deffn
  720 @deffn Option semantic-complete-inline-analyzer-idle-displayor-class
  721 The value of this variable determines how
  722 @code{semantic-complete-analyze-inline-idle} shows its completions.
  723 Possible values include:
  725 @table @code
  726 @item semantic-displayor-ghost
  727 Display completions ``inline'' with the buffer text, as described
  728 above.  This is the default value.
  730 @item semantic-displayor-tooltip
  731 Display completions in a tooltip.
  733 @item semantic-displayor-traditional
  734 Display completions in a separate window.
  735 @end table
  736 @end deffn
  738 @node Analyzer
  739 @section Analyzer
  740 @cindex Analyzer
  742 The Semantic Analyzer is a library for performing context analysis on
  743 source code.  It provides user commands for displaying, completing,
  744 and navigating through source code.
  746 @menu
  747 * Smart Completion::       Performing code completion.
  748 * Smart Summary::          Displaying help on a symbol.
  749 * Smart Jump::             Jumping to the definition of a tag.
  750 * Analyzer Debug::         Debugging problems with the analyzer.
  751 @end menu
  753 @node Smart Completion
  754 @subsection Smart Completion
  756 The Semantic Analyzer can be used to perform code completion in a
  757 manner that takes the local context into account.  (In addition to the
  758 user commands in this section, Semantic Idle Completions mode also
  759 uses the Semantic Analyzer.  @xref{Idle Completions Mode}.)
  761 @deffn Command semantic-analyze-possible-completions context
  762 This is the most basic command for Semantic Analyzer-based completion.
  763 Called interactively, it displays a list of the possible completions
  764 for the symbol at point.
  766 When called from a Lisp program,
  767 @code{semantic-analyze-possible-completions} does not display a
  768 completions list.  The argument @var{context} should be either a
  769 buffer position, or a context object.  The return value is a list of
  770 @semantic{} tag objects that complete the symbol for @var{context},
  771 based on the following criteria:
  773 @itemize
  774 @item Elements currently in scope.
  775 @item Constants currently in scope.
  776 @item Elements matching the context's @code{:prefix}.
  777 @item Type of the completion matching the type of the context.
  778 @end itemize
  780 Most of the other commands documented in this section call
  781 @code{semantic-analyze-possible-completions} internally.
  782 @end deffn
  784 @deffn Command semantic-complete-analyze-inline
  785 This command is bound to @kbd{C-c , @key{SPC}} when Semantic mode is
  786 enabled (@pxref{Semantic mode user commands}).  It displays a list of
  787 possible completions for the symbol at point, and activates a special
  788 set of keybindings for choosing a completion.
  790 You can type @key{RET} to accept the current completion, @kbd{M-n} and
  791 @kbd{M-p} to cycle through the possible completions, @key{TAB} to
  792 complete as far as possible and then cycle through completions, and
  793 either @kbd{C-g} or any other key to abort the completion.
  795 This command is similar to the completion performed by Semantic Idle
  796 Completions mode.  The main difference is that it is called
  797 explicitly, whereas Semantic Idle Completions mode completes during
  798 idle time (@pxref{Idle Completions Mode}).
  799 @end deffn
  801 @deffn Option semantic-complete-inline-analyzer-idle-displayor-class
  802 The value of this variable determines how
  803 @code{semantic-complete-analyze-inline} shows its completions.
  804 Possible values include:
  806 @table @code
  807 @item semantic-displayor-traditional
  808 Display completions in a separate window.  This is the default value.
  810 @item semantic-displayor-ghost
  811 Display completions ``inline'' with the buffer text, similar to the
  812 default behavior of Semantic Idle Completions mode (@pxref{Idle
  813 Completions Mode}).
  815 @item semantic-displayor-tooltip
  816 Display completions in a tooltip.
  817 @end table
  818 @end deffn
  820 In addition to @code{semantic-complete-analyze-inline}, you can use
  821 the simpler command @code{semantic-ia-complete-symbol point}.  This
  822 behaves like the usual @kbd{M-@key{TAB}} (@code{complete-symbol})
  823 command (@pxref{Symbol Completion,,,emacs,Emacs manual}), except it
  824 uses the Semantic Analyzer.
  826 @deffn Command semantic-ia-complete-symbol point
  827 Complete the current symbol at @var{point}.
  828 @end deffn
  830 @node Smart Summary
  831 @subsection Smart Summary
  833 You can use the following commands to obtain information about the
  834 code at point:
  836 @deffn Command semantic-ia-show-summary pos
  837 Display a summary for the symbol at @var{pos}.  Called interactively,
  838 @var{pos} defaults to point.
  839 @end deffn
  841 @deffn Command semantic-ia-show-doc pos
  842 Display the code-level documentation for the symbol at @var{pos}.
  843 Called interactively, @var{pos} defaults to point.
  844 @end deffn
  846 @deffn Command semantic-ia-describe-class typename
  847 Prompt for the name of a data type, @var{typename}, and display its
  848 components.  For instance, if the type in question is a class, this
  849 displays the methods and member variables.
  850 @end deffn
  852 You can also use Semantic Idle Summary mode to show information about
  853 the current symbol in the echo area during idle time.  @xref{Idle
  854 Summary Mode}.
  856 @node Smart Jump
  857 @subsection Smart Jump
  859 The Semantic Analyzer can be used to jump directly to the definition
  860 for a code symbol.
  862 @deffn Command semantic-ia-fast-jump pos
  863 Jump to the definition for the symbol at @var{pos}.  Called
  864 interactively, @var{pos} defaults to point.
  865 @end deffn
  867 @defun semantic-ia-fast-mouse-jump event
  868 Jump to the definition for the symbol at the position of the mouse
  869 event @var{event}.  This command is meant to be bound to a mouse
  870 command, like this:
  872 @example
  873 (global-set-key '[(S-mouse-1)] semantic-ia-fast-mouse-jump)
  874 @end example
  875 @end defun
  877 These commands are often more accurate than the @code{xref-find-definitions}
  878 command (@pxref{Looking Up Identifiers,,,emacs,Emacs manual}), because
  879 the Semantic Analyzer is context-sensitive.
  881 You can also use @kbd{C-c , j} (@code{semantic-complete-jump-local})
  882 and @kbd{C-c , J} (@code{semantic-complete-jump}) to navigate tags.
  883 @xref{Semantic mode user commands}.  Those commands do not make use of
  884 the Semantic Analyzer.
  886 @node Analyzer Debug
  887 @subsection Debugging the Semantic Analyzer
  889 If the Semantic Analyzer does not analyze your code properly, you can
  890 take steps to identify and solve the problem.  This section was
  891 written with C/C++ in mind, but should be relevant for any typed
  892 language.
  894 @subsubsection Step 1: Check the context
  896 To check the current context, type @kbd{M-x
  897 semantic-analyze-current-context}.
  899 @deffn Command semantic-analyze-current-context pos
  900 Analyze the context at @var{pos}.  This function is used by most of
  901 the other Semantic Analyzer commands to obtain the context of the code
  902 at a given buffer position.  The return value is an EIEIO object
  903 describing the context at @var{pos} (@pxref{Top,,,eieio,EIEIO
  904 manual}).
  906 When called interactively, this displays a @file{*Semantic Context
  907 Analysis*} buffer containing a summary of the context at point.
  908 @end deffn
  910 @noindent
  911 The Prefix section of the @file{*Semantic Context Analysis*} buffer
  912 lists the tags based on the text at point.  If it shows only a simple
  913 string, the Semantic was unable to identify what the data type was.
  915 The first item in the list of the prefix is the first lookup failure
  916 in the chain, and that is the item to focus debugging effort on.  For
  917 example:
  919 @example
  920 Context Type: #<semantic-analyze-context context>
  921 Bounds: (182 . 185)
  922 Prefix: Foo* bar
  923         int bbb (const char* y)
  924 Prefix Types: class Foo @{@}
  925 --------
  926 -> Local Vars: int argc
  927                char** argv
  928 @end example
  930 In this example you can see that the prefix has two fully found tags.
  931 In the following example, the symbol ``bbb'' is incomplete, and could
  932 not be found:
  934 @example
  935 Context Type: #<semantic-analyze-context context>
  936 Bounds: (182 . 184)
  937 Prefix: Foo* bar
  938         "bb"
  939 Prefix Classes: 'function
  940                 'variable
  941 Prefix Types: class Foo @{@}
  942 --------
  943 -> Local Vars: int argc
  944                char** argv
  945 @end example
  947 @subsubsection Step 2 : Check your include path
  949 Once you know the missing symbol, check your include path.  The header
  950 or include file containing the needed definition may not be in the
  951 list of headers @semantic{} is searching through.  To get a basic
  952 list, you can use @kbd{M-x semanticdb-find-test-translate-path}.
  953 @xref{Semanticdb search debugging commands}.
  955 If items should be loaded but aren't, or if you see some tables that
  956 have no tags in them, then you may have an incorrectly-set search
  957 throttle (@pxref{Search Throttle}).  For example,
  959 @example
  960 *#<semanticdb-table main.cpp (4 tags DIRTY)>
  961 *#<semanticdb-table foo.hh (0 tags DIRTY)>
  962 @end example
  964 Here, @semantic{} found @file{foo.hh}, but there are 0 tags.  This may
  965 be because you had set the throttle to avoid reading and parsing files
  966 that Emacs has not visited.  To fix this, visit the file and let
  967 @semantic{} parse it.
  969 For C++, check also that the @samp{#include} statements for your
  970 project-level files use quotes, not angle brackets; angle brackets are
  971 for system files.
  973 @subsubsection Step 3: Check the local scope
  975 If your data type is somehow abbreviated based on scope, such as from
  976 a @code{using} statement, you should make sure that the symbol you
  977 want is in the local scope.  Examine the scope with @kbd{M-x
  978 semantic-calculate-scope}.  The scope structure is displayed in ADEBUG
  979 mode, so use @kbd{SPC} to expand different elements and looking for
  980 your symbol.
  982 If your symbol should be in the scope, but you cannot find it, then
  983 you may have found a language support bug in the local-variable
  984 parser, or using statement parser.
  986 Calling @kbd{M-x bovinate} should force a reset on the scope in case
  987 there is merely some bad state.
  989 @example
  990  ] Name: Cache
  991  ] Class: #'semantic-scope-cache
  992  ] :table #<semanticdb-table testsubclass.cpp (13 tags DIRTY)>
  993  ] tag createMoose : class moose
  994  ] scopetypes 'nil
  995  ] parents #<TAG LIST: 1 entries>
  996  ] scope #<TAG LIST: 22 entries>
  997  ] fullscope #<TAG LIST: 23 entries>
  998  ] localvar #<TAG LIST: 6 entries>
  999 @end example
 1001 In the above sample output, the @code{tag} slot specifies where within
 1002 you source this scope is relevant.  @code{Parents} should contain any
 1003 in scope parents, such as the class a method belongs to.
 1004 @code{Localvar} should contain your local variables.  @code{Scope}
 1005 should contain datatypes in scope due to a @code{using} statement or
 1006 the like.
 1008 @subsubsection Step 4: Check the typecache
 1010 For complex typed languages like C++, @semantic{} creates a typecache,
 1011 or an optimized search table with all the various data types in it.
 1012 Elements in the typecache do not obey local scope.  It only contains
 1013 fully qualified names.  You can examine the typecache with
 1014 @kbd{M-x semanticdb-typecache-dump}.
 1016 If your data types are not in the typecache, there may be some parsing
 1017 error or other bug.  Calling @kbd{M-x bovinate} should force a reset on
 1018 the typecache in case there is merely some bad state.
 1020 @example
 1021 ]#<semanticdb-typecache /home/zappo/cedet/semantic/tests/testsubclass.cpp>
 1022    ] Name: /home/zappo/cedet/semantic/tests/testsubclass.cpp
 1023    ] Class: #'semanticdb-typecache
 1024    ] filestream 'nil
 1025    ] includestream #<TAG LIST: 84 entries>
 1026    ] stream 'nil
 1027    ] dependants 'nil
 1028 @end example
 1030 In the above example, the output of @kbd{M-x semanticdb-typecache-dump}
 1031 was expanded one level.  The @code{filestream} slot should contain
 1032 datatypes in the current file.  The @code{includestream} should
 1033 contain all the datatypes in all included header files.
 1035 The @code{dependants} slot will specify other files that depend on
 1036 this one.
 1038 @subsubsection Step 5: Check the parser
 1040 Go to the location where your unfound tag should be.  You can call
 1041 @kbd{M-x bovinate}, and see a dump of the raw tag structure.  To see a
 1042 navigable tree, use @kbd{M-x semantic-adebug-bovinate} instead.  You
 1043 can then look to make sure your tag has been properly parsed.
 1045 If it has not, then you may have found a parser bug.  To get a feel
 1046 how @semantic{} treats your file, type @kbd{M-x
 1047 global-semantic-show-unmatched-syntax-mode}.  This causes any syntax
 1048 it cannot parse to be underlined in red.
 1050 If your type is not parsable, it could be for a couple of reasons:
 1052 @enumerate
 1053 @item
 1054 If there is a MACRO keyword used in the definition of the type, you
 1055 may need to update the @code{semantic-lex-c-preprocessor-symbol-map}
 1056 to account for it.
 1058 @item
 1059 Or perhaps the parser needs to be fixed.
 1060 @end enumerate
 1062 @node Speedbar
 1063 @section Speedbar
 1064 @cindex speedbar
 1066 You can integrate @semantic{} with the Speedbar.
 1067 @xref{Speedbar,,,emacs,Emacs manual}.  To do this, add the following
 1068 line to your init file:
 1070 @example
 1071 (add-hook 'speedbar-load-hook (lambda () (require 'semantic/sb)))
 1072 @end example
 1074 @noindent
 1075 Or, alternatively:
 1077 @example
 1078 (require 'semantic/sb)
 1079 @end example
 1081 Once installed, the Speedbar will use @semantic{} to find and display
 1082 tags.  Tags from @semantic{} are displayed with more details than
 1083 ordinary Speedbar tags, such as function arguments and return type.
 1085 In addition, you can use the Speedbar to show the output of the
 1086 Semantic Analyzer (@pxref{Analyzer}).  To do this, go to the
 1087 @samp{Display} menu item on the Speedbar menu and select
 1088 @samp{Analyze}; or type @kbd{M-x semantic-speedbar-analysis}.
 1090 @deffn Command semantic-speedbar-analysis
 1091 Start the Speedbar in Semantic Analysis mode.
 1092 @end deffn
 1094 In Semantic Analysis mode, the Speedbar displays information about the
 1095 local context, such as the current function, local arguments and
 1096 variables, and details on the prefix (the current symbol).  Each entry
 1097 has an @samp{<i>} button; clicking on this shows a summary of what
 1098 @semantic{} knows about that variable or type.  The Speedbar also
 1099 displays a list of possible completions at point.
 1101 @node SymRef
 1102 @section Symbol References
 1103 @cindex symref
 1105 @semantic{} can interface with external @dfn{symbol reference tools},
 1106 such as GNU Global and GNU Idutils.  These tools provide information
 1107 about where different tags or symbols appear.
 1109 By default, @semantic{} tries to look for the best external symbol
 1110 reference tool that can be used.  The supported tools are GNU Global,
 1111 GNU Idutils, CScope, and Grep (the fallback method).  For best
 1112 results, use GNU Global.  However, @semantic{} does not manage your
 1113 GNU Global tables for you; you must manage them yourself.
 1115 @defvar semantic-symref-tool
 1116 The value of this variable is a symbol that determines the external
 1117 symbol reference tool to use.  The default value, @code{detect}, says
 1118 to look for the best available tool.  Other possible values are
 1119 @code{global}, @code{idutils}, @code{cscope}, and @code{grep}.  Note
 1120 that @code{grep} is much slower than the others.
 1121 @end defvar
 1123 The commands to display symbol references are @kbd{C-c , g}
 1124 (@code{semantic-symref-symbol} and @kbd{C-c , G}
 1125 (@code{semantic-symref}).  These keybindings are available whenever
 1126 Semantic mode is enabled (@pxref{Semantic mode user commands}).
 1128 @deffn Command semantic-symref-symbol sym
 1129 This command (normally bound to @kbd{C-c , g}) prompts for a symbol
 1130 name, and uses an external reference tool to find references to that
 1131 tag.
 1132 @end deffn
 1134 @deffn Command semantic-symref
 1135 This command (normally bound to @kbd{C-c , G}) uses an external
 1136 reference tool to find references to the current tag.
 1137 @end deffn
 1139 Both @code{semantic-symref-symbol} and @code{semantic-symref} display
 1140 a list of symbol references in a separate buffer.  The entries are
 1141 organized by file, and by function name.  Typing @key{RET} on the
 1142 @samp{[+]} next to each function name ``expands'' that entry, listing
 1143 all references to the target symbol occurring within that function.
 1144 Typing @kbd{RET} on a reference line jumps to that reference.
 1146 @node MRU Bookmarks
 1147 @section MRU Bookmarks mode
 1148 @cindex @code{semantic-mru-bookmark-mode}
 1150 Semantic MRU Bookmarks mode is a minor mode that keeps track of the
 1151 tags you have edited, allowing you to quickly return to them later
 1152 (MRU stands for ``Most Recently Used'').
 1154 @deffn Command global-semantic-mru-bookmark-mode &optional arg
 1155 Toggle Semantic MRU Bookmarks mode globally.  The minor mode can be
 1156 turned on only if the current buffer was set up for parsing.  With
 1157 argument @var{arg}, turn the minor mode if @var{arg} is positive, and
 1158 off otherwise.
 1159 @end deffn
 1161 Semantic MRU Bookmarks mode takes note of each tag you edit.
 1162 Afterwards, you can type @kbd{C-x B}
 1163 (@code{semantic-mrub-switch-tags}) to return to a tag.  This command
 1164 prompts for a tag name, completing with the names of edited tags; at
 1165 the prompt, you can use @kbd{M-p} and @kbd{M-n} to cycle through tags
 1166 in order of last modification time.
 1168 @node Sticky Func Mode
 1169 @section Sticky Function mode
 1171 Semantic Sticky Function minor mode displays a header line that shows
 1172 the declaration line of the function or tag on the topmost line in the
 1173 text area.  This allows you to keep that declaration line in view at
 1174 all times, even if it is scrolls off the ``top'' of the screen.
 1176 In addition, clicking @kbd{mouse-1} on the header line opens a context
 1177 menu that contains menu items for copying, killing, or narrowing to
 1178 that tag.
 1180 @deffn Command global-semantic-stickyfunc-mode &optional arg
 1181 Toggle Semantic Sticky Function mode in all Semantic-enabled buffers.
 1182 With an optional argument @var{arg}, enable if @var{arg} is positive,
 1183 and disable otherwise.
 1184 @end deffn
 1186 @defvar semantic-stickyfunc-sticky-classes
 1187 The value of this variable is a list of tag classes that Semantic
 1188 Sticky Function mode makes ``sticky''.  The default is
 1189 @code{'(function type)}, meaning function declarations and type
 1190 declarations.  Other possible tag classes are @code{variable},
 1191 @code{include}, and @code{package}.
 1192 @end defvar
 1194 @node Highlight Func Mode
 1195 @section Highlight Func Mode
 1196 @cindex @code{semantic-highlight-func-mode}
 1198 Semantic Highlight Function minor mode highlights the declaration line
 1199 of the current function or tag (that is to say, the first line that
 1200 describes the rest of the construct).
 1202 In addition, clicking @kbd{mouse-3} on the highlighted declaration
 1203 line opens a context menu that contains menu items for copying,
 1204 killing, or narrowing to that tag.
 1206 The tag classes highlighted by Semantic Highlight Function mode are
 1207 the same ones given by @code{semantic-stickyfunc-sticky-classes}.
 1208 @xref{Sticky Func Mode}.
 1210 @defun global-semantic-highlight-func-mode &optional arg
 1211 Toggle Semantic Highlight Function mode in all Semantic-enabled
 1212 buffers.  With an optional argument @var{arg}, enable if @var{arg} is
 1213 positive, and disable otherwise.
 1214 @end defun
 1216 @deffn Face semantic-highlight-func-current-tag-face
 1217 This face is used to highlight declaration lines in Semantic Highlight
 1218 Func mode.
 1219 @end deffn
 1221 @node Tag Decoration Mode
 1222 @section Tag Decoration Mode
 1223 @cindex @code{semantic-decoration-mode}
 1225 Semantic Tag Decoration mode ``decorates'' each tag based on certain
 1226 arbitrary features of that tag.  Decorations are specified using the
 1227 variable @code{semantic-decoration-styles}.
 1229 @deffn Command global-semantic-decoration-mode &optional arg
 1230 Toggle Semantic Tag Decoration mode in all Semantic-enabled buffers.
 1231 With an optional argument @var{arg}, enable if @var{arg} is positive,
 1232 and disable otherwise.
 1233 @end deffn
 1235 @defvar semantic-decoration-styles
 1236 The value of this variable is a list of decoration styles for Semantic
 1237 Tag Decoration mode.  Each element in this list should have the form
 1238 @code{(@var{name} . @var{flag})}, where @var{name} is a style name (a
 1239 symbol) and @var{flag} is non-@code{nil} if the style is enabled.
 1241 The following styles are available:
 1243 @table @code
 1244 @item semantic-tag-boundary
 1245 Place an overline in front of each long tag (excluding prototypes).
 1247 @item semantic-decoration-on-private-members
 1248 Highlight class members that are designated as private.
 1250 @item semantic-decoration-on-protected-members
 1251 Highlight class members that are designated as protected.
 1253 @item semantic-decoration-on-includes
 1254 Highlight class members that are includes.  Clicking on the
 1255 highlighted include statements opens a context menu for configuring
 1256 @semantic{} includes.
 1257 @end table
 1258 @end defvar
 1260 To enable or disable specific decorations, use this function:
 1262 @deffn Command semantic-toggle-decoration-style name &optional arg
 1263 Prompt for a decoration style, @var{name}, and turn it on or off.
 1264 With prefix argument @var{arg}, turn on if positive, otherwise off.
 1265 Return non-@code{nil} if the decoration style is enabled.
 1266 @end deffn
 1268 @deffn Face semantic-tag-boundary-face
 1269 Face for long tags in the @code{semantic-tag-boundary} decoration
 1270 style.
 1271 @end deffn
 1273 @deffn Face semantic-decoration-on-private-members-face
 1274 Face for privately-scoped tags in the
 1275 @code{semantic-decoration-on-private-members} decoration style.
 1276 @end deffn
 1278 @deffn Face semantic-decoration-on-protected-members-face
 1279 Face for protected tags in the
 1280 @code{semantic-decoration-on-protected-members} decoration style.
 1281 @end deffn
 1283 @deffn Face semantic-decoration-on-includes
 1284 Face for includes that are not in some other state, in the
 1285 @code{semantic-decoration-on-includes} decoration style.
 1286 @end deffn
 1288 @deffn Face semantic-decoration-on-unknown-includes
 1289 Face for includes that cannot be found, in the
 1290 @code{semantic-decoration-on-includes} decoration style.
 1291 @end deffn
 1293 @deffn Face semantic-decoration-on-unparsed-includes
 1294 Face for includes that have not yet been parsed, in the
 1295 @code{semantic-decoration-on-includes} decoration style.
 1296 @end deffn
 1298 @subsection Creating New Decoration Modes
 1300 You can create new types of decorations using the following function:
 1302 @defun define-semantic-decoration-style name doc &rest flags
 1303 Define a new decoration style with @var{name}.
 1304 @var{doc} is a documentation string describing the decoration style @var{name}.
 1305 It is appended to auto-generated doc strings.
 1306 An optional list of @var{flags} can also be specified.  Flags are:
 1307   @code{:enabled} <value>  - specify the default enabled value for @var{name}.
 1310 This defines two new overload functions respectively called @code{NAME-p}
 1311 and @code{NAME-highlight}, for which you must provide a default
 1312 implementation in respectively the functions @code{NAME-p-default} and
 1313 @code{NAME-highlight-default}.  Those functions are passed a tag.  @code{NAME-p}
 1314 must return non-@code{nil} to indicate that the tag should be decorated by
 1315 @code{NAME-highlight}.
 1317 To put primary decorations on a tag @code{NAME-highlight}, use
 1318 functions like @dfn{semantic-set-tag-face},
 1319 @dfn{semantic-set-tag-intangible}, etc., found in the
 1320 semantic-decorate library.
 1322 To add other kind of decorations on a tag, @code{NAME-highlight} must use
 1323 @dfn{semantic-decorate-tag}, and other functions of the semantic
 1324 decoration @var{api} found in this library.
 1325 @end defun