aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChong Yidong2009-12-14 04:11:43 +0000
committerChong Yidong2009-12-14 04:11:43 +0000
commit8e6874337fd3451534f1f02a507fe8ead9aae177 (patch)
treee345d8a4fab3e245b71d54e88d7257b878901b47 /doc
parenta0cefee5c19d08b65d100d8fbf200b7159391548 (diff)
downloademacs-8e6874337fd3451534f1f02a507fe8ead9aae177.tar.gz
emacs-8e6874337fd3451534f1f02a507fe8ead9aae177.zip
* sem-user.texi (Semantic mode, Idle Scheduler, Smart Completion)
(Smart Jump, Analyzer Debug): Copyedits. (Semantic mode user commands): Link to new nodes. (Speedbar, SymRef, MRU Bookmarks, Sticky Func Mode) (Highlight Func Mode, Tag Decoration Mode): New nodes, from the upstream Semantic manual. * semantic.texi (Introduction): Minor fix to diagram.
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/ChangeLog11
-rw-r--r--doc/misc/sem-user.texi479
-rw-r--r--doc/misc/semantic.texi21
3 files changed, 369 insertions, 142 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 05ee0cfb357..0e467c22d61 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,14 @@
12009-12-14 Chong Yidong <cyd@stupidchicken.com>
2
3 * sem-user.texi (Semantic mode, Idle Scheduler, Smart Completion)
4 (Smart Jump, Analyzer Debug): Copyedits.
5 (Semantic mode user commands): Link to new nodes.
6 (Speedbar, SymRef, MRU Bookmarks, Sticky Func Mode)
7 (Highlight Func Mode, Tag Decoration Mode): New nodes, from the
8 upstream Semantic manual.
9
10 * semantic.texi (Introduction): Minor fix to diagram.
11
12009-12-09 Michael Albinus <michael.albinus@gmx.de> 122009-12-09 Michael Albinus <michael.albinus@gmx.de>
2 13
3 * eshell.texi (History): Add the other built-in variables. 14 * eshell.texi (History): Add the other built-in variables.
diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi
index e5ba2fb072b..9c6a43ac3ce 100644
--- a/doc/misc/sem-user.texi
+++ b/doc/misc/sem-user.texi
@@ -11,24 +11,31 @@
11@c section entitled ``GNU Free Documentation License''. 11@c section entitled ``GNU Free Documentation License''.
12 12
13You can begin using @semantic{} by enabling Semantic mode, a global 13You can begin using @semantic{} by enabling Semantic mode, a global
14minor mode: type @kbd{M-x semantic-mode}, or click on the @samp{Source 14minor mode: type @kbd{M-x semantic-mode}, or open the @samp{Tools}
15Code Parsers (Semantic)} menu item in the @samp{Tools} menu. 15menu and click on the menu item named @samp{Source Code Parsers
16(Semantic)}. @xref{Semantic mode}.
16 17
17When Semantic mode is turned on, Emacs automatically parses each file 18When Semantic mode is turned on, Emacs automatically parses each file
18you visit. This allows you to use @semantic{} user commands in those 19you visit. You can then use @semantic{} user commands in those
19buffers. It also enables a number of ``helper'' minor modes for 20buffers (@pxref{Semantic mode user commands}). You can also choose to
20saving tags, displaying tag information, and so forth. @xref{Semantic 21enable a number of ``helper'' minor modes for saving tags, displaying
21mode}. 22tag information, and so forth.
22 23
23To enable Semantic mode each time you start Emacs, add the line 24To enable Semantic mode each time you start Emacs, add the line
24@code{(semantic-mode 1)} to your initialization file. @xref{Init 25@code{(semantic-mode 1)} to your initialization file. @xref{Init
25File,,,emacs,Emacs manual}. 26File,,,emacs,Emacs manual}.
26 27
27@menu 28@menu
28* Semantic mode:: Global minor mode for @semantic{}. 29* Semantic mode:: Global minor mode for @semantic{}.
29* SemanticDB:: Caching parsed buffers between sessions. 30* SemanticDB:: Caching parsed buffers between sessions.
30* Idle Scheduler:: Performing @semantic{} operations when idle. 31* Idle Scheduler:: @semantic{} actions that occur when idle.
31* Analyzer:: Semantic tools for analyzing code. 32* Analyzer:: Semantic tools for analyzing code.
33* Speedbar:: Using @semantic{} with the Speedbar.
34* SymRef:: Interface to symbol reference tools.
35* MRU Bookmarks:: Managing tag ``bookmarks''.
36* Sticky Func Mode:: Showing declarations in the header line.
37* Highlight Func Mode:: Highlight the current function declaration.
38* Tag Decoration Mode:: Minor mode to decorate tags.
32@end menu 39@end menu
33 40
34@node Semantic mode 41@node Semantic mode
@@ -38,8 +45,9 @@ File,,,emacs,Emacs manual}.
38Semantic mode is a global minor mode for @semantic{} as a whole. When 45Semantic mode is a global minor mode for @semantic{} as a whole. When
39enabled, each file you visit is automatically parsed, provided its 46enabled, each file you visit is automatically parsed, provided its
40major mode is specified in the variable 47major mode is specified in the variable
41@code{semantic-new-buffer-setup-functions} (the default is to parse 48@code{semantic-new-buffer-setup-functions} (the default value of this
42every buffer @semantic{} knows how to parse). 49variable sets up parsing for all the parsers included with Emacs, but
50you may add to it if you install additional parsers).
43 51
44In each parser-enabled buffer, a number of @semantic{} commands are 52In each parser-enabled buffer, a number of @semantic{} commands are
45available for navigating, querying, and editing source code. 53available for navigating, querying, and editing source code.
@@ -48,14 +56,13 @@ installs a @samp{Development} menu on the menu-bar, with many of these
48commands. 56commands.
49 57
50In addition, enabling Semantic mode turns on certain auxiliary global 58In addition, enabling Semantic mode turns on certain auxiliary global
51minor modes, as specified by the variable 59minor modes. The variable @code{semantic-default-submodes} determines
52@code{semantic-default-submodes}. The default auxiliary modes are 60which auxiliary modes are enabled; the defaults are SemanticDB mode
53SemanticDB mode (@pxref{SemanticDB}) and Global Semantic Idle 61(@pxref{SemanticDB}) and Global Semantic Idle Scheduler mode
54Scheduler mode (@pxref{Idle Scheduler}). You can also toggle the 62(@pxref{Idle Scheduler}). You can also toggle the auxiliary minor
55auxiliary minor modes separately, using their mode functions 63modes separately, using their mode functions (e.g. @kbd{M-x
56(e.g. @kbd{M-x semanticdb-minor-mode}), or via the @samp{Development} 64semanticdb-minor-mode}), or via the @samp{Development} menu. The
57menu. These auxiliary minor modes are described in the following 65various auxiliary minor modes are described in the following sections.
58sections.
59 66
60@defvar semantic-new-buffer-setup-functions 67@defvar semantic-new-buffer-setup-functions
61The value of this variable is an alist of functions to call for 68The value of this variable is an alist of functions to call for
@@ -78,14 +85,14 @@ auxiliary minor modes to enable when enabling Semantic mode. The
78valid mode symbols are: 85valid mode symbols are:
79 86
80@itemize 87@itemize
81@item @code{semantic-idle-scheduler-mode} (@pxref{Idle Scheduler}). 88@item @code{global-semantic-idle-scheduler-mode} (@pxref{Idle Scheduler}).
82@item @code{semanticdb-minor-mode} (@pxref{SemanticDB}). 89@item @code{global-semanticdb-minor-mode} (@pxref{SemanticDB}).
83@item @code{semantic-idle-summary-mode} (@pxref{Idle Summary Mode}). 90@item @code{global-semantic-idle-summary-mode} (@pxref{Idle Summary Mode}).
84@item @code{semantic-idle-completions-mode} (@pxref{Idle Completions Mode}). 91@item @code{global-semantic-idle-completions-mode} (@pxref{Idle Completions Mode}).
85@item @code{semantic-highlight-func-mode} 92@item @code{global-semantic-highlight-func-mode} (@pxref{Highlight Func Mode}).
86@item @code{semantic-decoration-mode} 93@item @code{global-semantic-decoration-mode} (@pxref{Tag Decoration Mode}).
87@item @code{semantic-stickyfunc-mode} 94@item @code{global-semantic-stickyfunc-mode} (@pxref{Sticky Func Mode}).
88@item @code{semantic-mru-bookmark-mode} 95@item @code{global-semantic-mru-bookmark-mode} (@pxref{MRU Bookmarks}).
89@end itemize 96@end itemize
90@end defvar 97@end defvar
91 98
@@ -123,11 +130,13 @@ Display a list of the possible completions of the current tag
123 130
124@item C-c , g 131@item C-c , g
125Prompt for a tag, and display a list of tags that call it 132Prompt for a tag, and display a list of tags that call it
126(@code{semantic-symref-symbol}). 133(@code{semantic-symref-symbol}). This relies on the presence of an
134external symbol reference tool. @xref{SymRef}.
127 135
128@item C-c , G 136@item C-c , G
129Display a list of tags that call the current tag 137Display a list of tags that call the current tag
130(@code{semantic-symref}). 138(@code{semantic-symref}). This relies on the presence of an external
139symbol reference tool. @xref{SymRef}.
131 140
132@item C-c , p 141@item C-c , p
133Move point to the previous tag (@code{senator-previous-tag}). 142Move point to the previous tag (@code{senator-previous-tag}).
@@ -226,7 +235,6 @@ want to create it.
226You can change the name of the SemanticDB directory by customizing the 235You can change the name of the SemanticDB directory by customizing the
227variable @code{semanticdb-default-save-directory}. 236variable @code{semanticdb-default-save-directory}.
228 237
229@anchor{semanticdb-default-save-directory}
230@deffn Option semanticdb-default-save-directory 238@deffn Option semanticdb-default-save-directory
231The name of the directory where SemanticDB cache files are saved. If 239The name of the directory where SemanticDB cache files are saved. If
232the value is @code{nil}, SemanticDB saves its data into a single file, 240the value is @code{nil}, SemanticDB saves its data into a single file,
@@ -234,7 +242,6 @@ in the current directory, whose filename is given by
234@code{semanticdb-default-file-name}. 242@code{semanticdb-default-file-name}.
235@end deffn 243@end deffn
236 244
237@anchor{semanticdb-default-file-name}
238@deffn Option semanticdb-default-file-name 245@deffn Option semanticdb-default-file-name
239The name of a cache file in which to save SemanticDB, when 246The name of a cache file in which to save SemanticDB, when
240@code{semanticdb-default-save-directory} is @code{nil}. 247@code{semanticdb-default-save-directory} is @code{nil}.
@@ -244,7 +251,6 @@ You can force SemanticDB to save the data from only certain files, or
244suppress saving altogether, by customizing 251suppress saving altogether, by customizing
245@code{semanticdb-persistent-path}: 252@code{semanticdb-persistent-path}:
246 253
247@anchor{semanticdb-persistent-path}
248@deffn Option semanticdb-persistent-path 254@deffn Option semanticdb-persistent-path
249List of valid paths for SemanticDB to cache. Each element should be a 255List of valid paths for SemanticDB to cache. Each element should be a
250directory name (a string); then the parse data from any file in that 256directory name (a string); then the parse data from any file in that
@@ -260,7 +266,6 @@ saving directory based on the variable
260The default value is @code{(always)}. 266The default value is @code{(always)}.
261@end deffn 267@end deffn
262 268
263@anchor{semanticdb-project-predicate-functions}
264@defvar semanticdb-project-predicate-functions 269@defvar semanticdb-project-predicate-functions
265The value of this variable is a list of predicates for indicating that 270The value of this variable is a list of predicates for indicating that
266a directory belongs to a project. This list is used when the value of 271a directory belongs to a project. This list is used when the value of
@@ -273,7 +278,6 @@ variable. This allows SemanticDB to save tag caches in directories
273controlled by them. 278controlled by them.
274@end defvar 279@end defvar
275 280
276@anchor{semanticdb-save-database-hooks}
277@deffn Option semanticdb-save-database-hooks 281@deffn Option semanticdb-save-database-hooks
278Abnormal hook run after a database is saved. Each function is called 282Abnormal hook run after a database is saved. Each function is called
279with one argument, the object representing the database recently 283with one argument, the object representing the database recently
@@ -303,9 +307,9 @@ based on whether the @code{#include} directive uses the @code{""} or
303the @dfn{system include path} (@pxref{Include paths}). 307the @dfn{system include path} (@pxref{Include paths}).
304 308
305@menu 309@menu
306* Search Throttle:: Controlling how semanticdb searches occur 310* Search Throttle:: Controlling how semanticdb searches occur.
307* Semanticdb Roots:: Specifying the root of different projects 311* Semanticdb Roots:: Specifying the root of different projects.
308* Include paths:: Add/Remove directories to include search paths 312* Include paths:: Specifying the directories to search.
309* Semanticdb search debugging commands:: 313* Semanticdb search debugging commands::
310@end menu 314@end menu
311 315
@@ -328,7 +332,6 @@ for a given major mode, like this:
328 '(project unloaded system recursive)) 332 '(project unloaded system recursive))
329@end example 333@end example
330 334
331@anchor{semanticdb-find-default-throttle}
332@defvar semanticdb-find-default-throttle 335@defvar semanticdb-find-default-throttle
333The default throttle for @code{semanticdb-find} routines. 336The default throttle for @code{semanticdb-find} routines.
334The throttle controls how detailed the list of database 337The throttle controls how detailed the list of database
@@ -377,7 +380,6 @@ If you use EDE for project management, it will set the project roots
377automatically. @xref{Top,,,ede,EDE manual}. You can also specify 380automatically. @xref{Top,,,ede,EDE manual}. You can also specify
378them yourself. 381them yourself.
379 382
380@anchor{semanticdb-project-roots}
381@deffn Option semanticdb-project-roots 383@deffn Option semanticdb-project-roots
382The value of this variable is a list of directories (strings) that are 384The value of this variable is a list of directories (strings) that are
383project roots. All subdirectories of a project root are considered 385project roots. All subdirectories of a project root are considered
@@ -385,7 +387,6 @@ part of the same project. This variable can be overriden by
385@code{semanticdb-project-root-functions}. 387@code{semanticdb-project-root-functions}.
386@end deffn 388@end deffn
387 389
388@anchor{semanticdb-project-root-functions}
389@defvar semanticdb-project-root-functions 390@defvar semanticdb-project-root-functions
390The value of this variable is a list of functions to determine a given 391The value of this variable is a list of functions to determine a given
391directory's project root. These functions are called, one at a time, 392directory's project root. These functions are called, one at a time,
@@ -406,26 +407,22 @@ subdirectories on Unix-like operating systems.
406You can add and remove system include paths using the following 407You can add and remove system include paths using the following
407commands: 408commands:
408 409
409@anchor{semantic-add-system-include}
410@deffn Command semantic-add-system-include dir &optional mode 410@deffn Command semantic-add-system-include dir &optional mode
411Prompts for a directory, @var{dir}, and add it as a system include 411Prompts for a directory, @var{dir}, and add it as a system include
412path for the current major mode. When called non-interactively, the 412path for the current major mode. When called non-interactively, the
413major mode can be specified with the @var{mode} argument. 413major mode can be specified with the @var{mode} argument.
414@end deffn 414@end deffn
415 415
416@anchor{semantic-remove-system-include}
417@deffn Command semantic-remove-system-include dir &optional mode 416@deffn Command semantic-remove-system-include dir &optional mode
418Prompt for a directory, @var{dir}, and remove it from the system 417Prompt for a directory, @var{dir}, and remove it from the system
419include path for the current major mode (or @var{mode}). 418include path for the current major mode (or @var{mode}).
420@end deffn 419@end deffn
421 420
422@anchor{semantic-customize-system-include-path}
423@deffn Command semantic-customize-system-include-path &optional mode 421@deffn Command semantic-customize-system-include-path &optional mode
424Customize the system include path for the current major mode (or 422Customize the system include path for the current major mode (or
425@var{mode}). 423@var{mode}).
426@end deffn 424@end deffn
427 425
428@anchor{semanticdb-implied-include-tags}
429@defun semanticdb-implied-include-tags 426@defun semanticdb-implied-include-tags
430Include tags implied for all files of a given mode. You can set this 427Include tags implied for all files of a given mode. You can set this
431variable with @code{defvar-mode-local} for a particular mode so that 428variable with @code{defvar-mode-local} for a particular mode so that
@@ -446,11 +443,9 @@ encountered, but could not find on disk using @kbd{M-x
446semanticdb-find-adebug-lost-includes}. 443semanticdb-find-adebug-lost-includes}.
447 444
448@deffn Command semanticdb-dump-all-table-summary 445@deffn Command semanticdb-dump-all-table-summary
449@anchor{semanticdb-dump-all-table-summary}
450Dump a list of all databases in Emacs memory. 446Dump a list of all databases in Emacs memory.
451@end deffn 447@end deffn
452 448
453@anchor{semanticdb-find-test-translate-path}
454@deffn Command semanticdb-find-test-translate-path &optional arg 449@deffn Command semanticdb-find-test-translate-path &optional arg
455Call and output results of @dfn{semanticdb-find-translate-path}. In 450Call and output results of @dfn{semanticdb-find-translate-path}. In
456the displayed buffer, you can type @key{SPC} to expand items. With 451the displayed buffer, you can type @key{SPC} to expand items. With
@@ -458,7 +453,6 @@ the displayed buffer, you can type @key{SPC} to expand items. With
458@end deffn 453@end deffn
459 454
460@deffn Command semanticdb-find-adebug-lost-includes 455@deffn Command semanticdb-find-adebug-lost-includes
461@anchor{semanticdb-find-adebug-lost-includes}
462Translate the current path, then display the lost includes. 456Translate the current path, then display the lost includes.
463Examines the variable @code{semanticdb-find-lost-includes}. 457Examines the variable @code{semanticdb-find-lost-includes}.
464@end deffn 458@end deffn
@@ -466,7 +460,6 @@ Examines the variable @code{semanticdb-find-lost-includes}.
466Lastly, you can test an explicit search term using this command: 460Lastly, you can test an explicit search term using this command:
467 461
468@deffn Command semantic-adebug-searchdb regex 462@deffn Command semantic-adebug-searchdb regex
469@anchor{semantic-adebug-searchdb}
470Search the semanticdb for @var{regex} for the current buffer. 463Search the semanticdb for @var{regex} for the current buffer.
471Display the results as a debug list. 464Display the results as a debug list.
472@end deffn 465@end deffn
@@ -482,7 +475,6 @@ The default is to save databases in flat files. Alternatively, you
482could write a new database backend that stores tags into a database, 475could write a new database backend that stores tags into a database,
483or other storage system. 476or other storage system.
484 477
485@anchor{semanticdb-new-database-class}
486@defvar semanticdb-new-database-class 478@defvar semanticdb-new-database-class
487The default type of database created for new files. This can be 479The default type of database created for new files. This can be
488changed on a per file basis, so that some directories are saved using 480changed on a per file basis, so that some directories are saved using
@@ -498,7 +490,6 @@ for them once, which will be used over and over for tools such as
498summary-mode, or the analyzer. 490summary-mode, or the analyzer.
499 491
500@deffn Command semanticdb-create-ebrowse-database dir 492@deffn Command semanticdb-create-ebrowse-database dir
501@anchor{semanticdb-create-ebrowse-database}
502Create an @var{ebrowse} database for directory @var{dir}. 493Create an @var{ebrowse} database for directory @var{dir}.
503The database file is stored in ~/.semanticdb, or whichever directory 494The database file is stored in ~/.semanticdb, or whichever directory
504is specified by @code{semanticdb-default-system-save-directory}. 495is specified by @code{semanticdb-default-system-save-directory}.
@@ -508,13 +499,13 @@ is specified by @code{semanticdb-default-system-save-directory}.
508@section Idle Scheduler 499@section Idle Scheduler
509@cindex Idle Scheduler 500@cindex Idle Scheduler
510 501
511The @dfn{Semantic idle scheduler} is a part of @semantic{} that 502The @dfn{Semantic Idle Scheduler} is a part of @semantic{} that
512performs various operations while Emacs is waiting for user input 503performs various operations while Emacs is waiting for user input
513(idle time). Its primary job is to perform buffer parsing, but it is 504(idle time). Its primary job is to perform buffer parsing during idle
514also used for other purposes, such as displaying information about 505time. You can also use the Idle Scheduler to display function
515tags. 506prototypes (@pxref{Idle Summary Mode}) or symbol completions
507(@pxref{Idle Completions Mode}).
516 508
517@anchor{global-semantic-idle-scheduler-mode}
518@deffn Command global-semantic-idle-scheduler-mode &optional arg 509@deffn Command global-semantic-idle-scheduler-mode &optional arg
519This command toggles Semantic Idle Scheduler mode in every 510This command toggles Semantic Idle Scheduler mode in every
520@semantic{}-enabled buffer. This minor mode ensures that the buffer 511@semantic{}-enabled buffer. This minor mode ensures that the buffer
@@ -525,24 +516,22 @@ Mode}) and Semantic Idle Completions mode (@pxref{Idle Completions
525Mode}). 516Mode}).
526@end deffn 517@end deffn
527 518
528@anchor{semantic-idle-scheduler-idle-time}
529@deffn Option semantic-idle-scheduler-idle-time 519@deffn Option semantic-idle-scheduler-idle-time
530The value of this variable is the amount of idle time, in seconds, 520The value of this variable is the amount of idle time, in seconds,
531before the Semantic idle scheduler activates. The default is 1. 521before the Semantic idle scheduler activates. The default is 1.
532@end deffn 522@end deffn
533 523
534@anchor{semantic-idle-scheduler-verbose-flag}
535@deffn Option semantic-idle-scheduler-verbose-flag 524@deffn Option semantic-idle-scheduler-verbose-flag
536If this variable is non-@code{nil}, the idle scheduler prints verbose 525If this variable is non-@code{nil}, the idle scheduler prints verbose
537messages while running, which are useful for debugging. 526messages while running, which are useful for debugging.
538@end deffn 527@end deffn
539 528
540@menu 529@menu
541* Reparsing Options:: Reparsing the current buffer in idle time 530* Reparsing Options:: Reparsing the current buffer in idle time.
542* Idle Working Options:: Options for extra work done at idle time 531* Idle Working Options:: Options for extra work done at idle time.
543* Debugging Idle Time Issues:: How to produce good bug reports 532* Debugging Idle Time Issues:: How to produce good bug reports.
544* Idle Summary Mode:: Display prototype of symbol under cursor 533* Idle Summary Mode:: Display prototype of symbol under cursor.
545* Idle Completions Mode:: Smart completion pop-up help 534* Idle Completions Mode:: Smart completion pop-up help.
546@end menu 535@end menu
547 536
548@node Reparsing Options 537@node Reparsing Options
@@ -552,26 +541,22 @@ When activated during idle time, the Semantic idle scheduler
552automatically reparses all buffers that need it. Any arriving user 541automatically reparses all buffers that need it. Any arriving user
553input cancels this, returning Emacs to its normal editing behavior. 542input cancels this, returning Emacs to its normal editing behavior.
554 543
555@anchor{semantic-idle-scheduler-max-buffer-size}
556@deffn Option semantic-idle-scheduler-max-buffer-size 544@deffn Option semantic-idle-scheduler-max-buffer-size
557Maximum size in bytes of buffers automatically reparsed. If this 545Maximum size in bytes of buffers automatically reparsed. If this
558value is less than or equal to @var{0}, buffers are automatically 546value is less than or equal to @var{0}, buffers are automatically
559reparsed regardless of their size. 547reparsed regardless of their size.
560@end deffn 548@end deffn
561 549
562@anchor{semantic-idle-scheduler-no-working-message}
563@deffn Option semantic-idle-scheduler-no-working-message 550@deffn Option semantic-idle-scheduler-no-working-message
564If non-@code{nil}, disable display of working messages whie reparsing. 551If non-@code{nil}, disable display of working messages whie reparsing.
565@end deffn 552@end deffn
566 553
567@anchor{semantic-idle-scheduler-working-in-modeline-flag}
568@deffn Option semantic-idle-scheduler-working-in-modeline-flag 554@deffn Option semantic-idle-scheduler-working-in-modeline-flag
569If non-@code{nil}, show working messages in the mode line. Normally, 555If non-@code{nil}, show working messages in the mode line. Normally,
570re-parsing shows messages in the minibuffer; this moves the parse 556re-parsing shows messages in the minibuffer; this moves the parse
571message to the modeline instead. 557message to the modeline instead.
572@end deffn 558@end deffn
573 559
574@anchor{semantic-before-idle-scheduler-reparse-hook}
575@defvar semantic-before-idle-scheduler-reparse-hook 560@defvar semantic-before-idle-scheduler-reparse-hook
576This normal hook is run just before the idle scheduler begins 561This normal hook is run just before the idle scheduler begins
577reparsing. If any hook function throws an error, the value of this 562reparsing. If any hook function throws an error, the value of this
@@ -579,7 +564,6 @@ variable is reset to @code{nil}. This hook is not protected from
579lexical errors. 564lexical errors.
580@end defvar 565@end defvar
581 566
582@anchor{semantic-after-idle-scheduler-reparse-hook}
583@defvar semantic-after-idle-scheduler-reparse-hook 567@defvar semantic-after-idle-scheduler-reparse-hook
584 568
585This normal hook is run after the idle scheduler finishes reparsing. 569This normal hook is run after the idle scheduler finishes reparsing.
@@ -609,13 +593,11 @@ Because this extra work is quite time-consuming, it is only carried
609out after a longer idle delay. The following features control how the 593out after a longer idle delay. The following features control how the
610idle work is performed. 594idle work is performed.
611 595
612@anchor{semantic-idle-scheduler-work-idle-time}
613@deffn Option semantic-idle-scheduler-work-idle-time 596@deffn Option semantic-idle-scheduler-work-idle-time
614The value of this variable is the amount of idle time, in seconds, 597The value of this variable is the amount of idle time, in seconds,
615before commencing idle work. The default is 60. 598before commencing idle work. The default is 60.
616@end deffn 599@end deffn
617 600
618@anchor{semantic-idle-work-parse-neighboring-files-flag}
619@deffn Option semantic-idle-work-parse-neighboring-files-flag 601@deffn Option semantic-idle-work-parse-neighboring-files-flag
620If the value of this variable is non-@code{nil}, the Semantic idle 602If the value of this variable is non-@code{nil}, the Semantic idle
621scheduler uses idle work time to parse files in the same directory as 603scheduler uses idle work time to parse files in the same directory as
@@ -633,12 +615,10 @@ enable @code{debug-on-error}, because the idle scheduler inhibits the
633debugger. Instead, use the following commands to debug the error: 615debugger. Instead, use the following commands to debug the error:
634 616
635@deffn Command semantic-debug-idle-function 617@deffn Command semantic-debug-idle-function
636@anchor{semantic-debug-idle-function}
637Run the Semantic idle function with debugging turned on. 618Run the Semantic idle function with debugging turned on.
638@end deffn 619@end deffn
639 620
640@deffn Command semantic-debug-idle-work-function 621@deffn Command semantic-debug-idle-work-function
641@anchor{semantic-debug-idle-work-function}
642Run the Semantic idle work function with debugging turned on. 622Run the Semantic idle work function with debugging turned on.
643@end deffn 623@end deffn
644 624
@@ -650,8 +630,6 @@ summary of the symbol at point, such as its function prototype, in the
650echo area. Its functionality is similar to what ElDoc mode provides 630echo area. Its functionality is similar to what ElDoc mode provides
651for Emacs Lisp (@pxref{Lisp Doc,,,emacs,Emacs manual}). 631for Emacs Lisp (@pxref{Lisp Doc,,,emacs,Emacs manual}).
652 632
653@anchor{global-semantic-idle-summary-mode}
654@anchor{semantic-idle-summary-mode}
655@deffn global-semantic-idle-summary-mode &optional arg 633@deffn global-semantic-idle-summary-mode &optional arg
656This command toggles Semantic Idle Summary mode in all 634This command toggles Semantic Idle Summary mode in all
657@semantic{}-enabled buffers. You can also toggle it via the 635@semantic{}-enabled buffers. You can also toggle it via the
@@ -666,14 +644,12 @@ the idle time, as given by @code{semantic-idle-scheduler-idle-time}
666You can override the method for getting the current tag to display by 644You can override the method for getting the current tag to display by
667setting @code{idle-summary-current-symbol-info}. 645setting @code{idle-summary-current-symbol-info}.
668 646
669@anchor{semantic-idle-summary-function}
670@deffn Option semantic-idle-summary-function 647@deffn Option semantic-idle-summary-function
671The value of this variable should be a function to call to display tag 648The value of this variable should be a function to call to display tag
672information during idle time. See the variable 649information during idle time. See the variable
673@code{semantic-format-tag-functions} for a list of useful functions. 650@code{semantic-format-tag-functions} for a list of useful functions.
674@end deffn 651@end deffn
675 652
676@anchor{semantic-idle-summary-out-of-context-faces}
677@defvar semantic-idle-summary-out-of-context-faces 653@defvar semantic-idle-summary-out-of-context-faces
678The value of this variable is a list of font-lock faces indicating 654The value of this variable is a list of font-lock faces indicating
679useless summary contexts. These are generally faces used to highlight 655useless summary contexts. These are generally faces used to highlight
@@ -692,8 +668,6 @@ different alternatives.
692Semantic Idle Completions mode performs completion based on the 668Semantic Idle Completions mode performs completion based on the
693Semantic Analyzer (@pxref{Analyzer}). 669Semantic Analyzer (@pxref{Analyzer}).
694 670
695@anchor{global-semantic-idle-completions-mode}
696@anchor{semantic-idle-completions-mode}
697@deffn global-semantic-idle-completions-mode &optional arg 671@deffn global-semantic-idle-completions-mode &optional arg
698This command toggles Semantic Idle Completions mode in every 672This command toggles Semantic Idle Completions mode in every
699@semantic{}-enabled buffer. You can also toggle it via the @samp{Show 673@semantic{}-enabled buffer. You can also toggle it via the @samp{Show
@@ -743,7 +717,6 @@ Quit without completing (@code{semantic-complete-inline-quit}).
743You can also exit inline completion by issuing any other Emacs 717You can also exit inline completion by issuing any other Emacs
744command. The completion text then disappears from the buffer. 718command. The completion text then disappears from the buffer.
745 719
746@anchor{semantic-complete-analyze-inline-idle}
747@deffn Command semantic-complete-analyze-inline-idle 720@deffn Command semantic-complete-analyze-inline-idle
748This is the command for performing inline code completion. It is 721This is the command for performing inline code completion. It is
749called by Semantic Idle Completions mode during idle time, but you can 722called by Semantic Idle Completions mode during idle time, but you can
@@ -751,7 +724,6 @@ also call it yourself. It returns immediately, leaving the buffer in
751a state for inline completion. 724a state for inline completion.
752@end deffn 725@end deffn
753 726
754@anchor{semantic-complete-inline-analyzer-idle-displayor-class}
755@deffn Option semantic-complete-inline-analyzer-idle-displayor-class 727@deffn Option semantic-complete-inline-analyzer-idle-displayor-class
756The value of this variable determines how 728The value of this variable determines how
757@code{semantic-complete-analyze-inline-idle} shows its completions. 729@code{semantic-complete-analyze-inline-idle} shows its completions.
@@ -789,16 +761,14 @@ and navigating through source code.
789@subsection Smart Completion 761@subsection Smart Completion
790 762
791The Semantic Analyzer can be used to perform code completion in a 763The Semantic Analyzer can be used to perform code completion in a
792manner that takes the local context into account. 764manner that takes the local context into account. (In addition to the
793 765user commands in this section, Semantic Idle Completions mode also
794In addition to the user commands documented in this section, the 766uses the Semantic Analyzer. @xref{Idle Completions Mode}.)
795completions performed by Semantic Idle Completions mode also uses the
796Semantic Analyzer. @xref{Idle Completions Mode}.
797 767
798@deffn Command semantic-analyze-possible-completions context 768@deffn Command semantic-analyze-possible-completions context
799This is the most basic command for Semantic Analyzer-based completion. 769This is the most basic command for Semantic Analyzer-based completion.
800Called interactively, it displays in another window a list of the 770Called interactively, it displays a list of the possible completions
801possible completions for the symbol at point. 771for the symbol at point.
802 772
803When called from a Lisp program, 773When called from a Lisp program,
804@code{semantic-analyze-possible-completions} does not display a 774@code{semantic-analyze-possible-completions} does not display a
@@ -818,7 +788,6 @@ Most of the other commands documented in this section call
818@code{semantic-analyze-possible-completions} internally. 788@code{semantic-analyze-possible-completions} internally.
819@end deffn 789@end deffn
820 790
821@anchor{semantic-complete-analyze-inline}
822@deffn Command semantic-complete-analyze-inline 791@deffn Command semantic-complete-analyze-inline
823This command is bound to @kbd{C-c , @key{SPC}} when Semantic mode is 792This command is bound to @kbd{C-c , @key{SPC}} when Semantic mode is
824enabled (@pxref{Semantic mode user commands}). It displays a list of 793enabled (@pxref{Semantic mode user commands}). It displays a list of
@@ -836,7 +805,6 @@ explicitly, whereas Semantic Idle Completions mode completes during
836idle time (@pxref{Idle Completions Mode}). 805idle time (@pxref{Idle Completions Mode}).
837@end deffn 806@end deffn
838 807
839@anchor{semantic-complete-inline-analyzer-displayor-class}
840@deffn Option semantic-complete-inline-analyzer-idle-displayor-class 808@deffn Option semantic-complete-inline-analyzer-idle-displayor-class
841The value of this variable determines how 809The value of this variable determines how
842@code{semantic-complete-analyze-inline} shows its completions. 810@code{semantic-complete-analyze-inline} shows its completions.
@@ -860,9 +828,8 @@ In addition to @code{semantic-complete-analyze-inline}, you can use
860the simpler command @code{semantic-ia-complete-symbol point}. This 828the simpler command @code{semantic-ia-complete-symbol point}. This
861behaves like the usual @kbd{M-@key{TAB}} (@code{complete-symbol}) 829behaves like the usual @kbd{M-@key{TAB}} (@code{complete-symbol})
862command (@pxref{Symbol Completion,,,emacs,Emacs manual}), except it 830command (@pxref{Symbol Completion,,,emacs,Emacs manual}), except it
863uses Semantic Analyzer. 831uses the Semantic Analyzer.
864 832
865@anchor{semantic-ia-complete-symbol}
866@deffn Command semantic-ia-complete-symbol point 833@deffn Command semantic-ia-complete-symbol point
867Complete the current symbol at @var{point}. 834Complete the current symbol at @var{point}.
868@end deffn 835@end deffn
@@ -870,22 +837,19 @@ Complete the current symbol at @var{point}.
870@node Smart Summary 837@node Smart Summary
871@subsection Smart Summary 838@subsection Smart Summary
872 839
873You can use the commands in this section to find information about the 840You can use the following commands to obtain information about the
874code at point: 841code at point:
875 842
876@anchor{semantic-ia-show-summary}
877@deffn Command semantic-ia-show-summary pos 843@deffn Command semantic-ia-show-summary pos
878Display a summary for the symbol at @var{pos}. Called interactively, 844Display a summary for the symbol at @var{pos}. Called interactively,
879@var{pos} defaults to point. 845@var{pos} defaults to point.
880@end deffn 846@end deffn
881 847
882@anchor{semantic-ia-show-doc}
883@deffn Command semantic-ia-show-doc pos 848@deffn Command semantic-ia-show-doc pos
884Display the code-level documentation for the symbol at @var{pos}. 849Display the code-level documentation for the symbol at @var{pos}.
885Called interactively, @var{pos} defaults to point. 850Called interactively, @var{pos} defaults to point.
886@end deffn 851@end deffn
887 852
888@anchor{semantic-ia-describe-class}
889@deffn Command semantic-ia-describe-class typename 853@deffn Command semantic-ia-describe-class typename
890Prompt for the name of a data type, @var{typename}, and display its 854Prompt for the name of a data type, @var{typename}, and display its
891components. For instance, if the type in question is a class, this 855components. For instance, if the type in question is a class, this
@@ -900,17 +864,13 @@ Summary Mode}.
900@subsection Smart Jump 864@subsection Smart Jump
901 865
902The Semantic Analyzer can be used to jump directly to the definition 866The Semantic Analyzer can be used to jump directly to the definition
903for a code symbol. Because it is based on code analysis, its behavior 867for a code symbol.
904is often more accurate than than the @code{find-tag} command
905(@pxref{Tags,,,emacs,Emacs manual}).
906 868
907@anchor{semantic-ia-fast-jump}
908@deffn Command semantic-ia-fast-jump pos 869@deffn Command semantic-ia-fast-jump pos
909Jump to the definition for the symbol at @var{pos}. Called 870Jump to the definition for the symbol at @var{pos}. Called
910interactively, @var{pos} defaults to point. 871interactively, @var{pos} defaults to point.
911@end deffn 872@end deffn
912 873
913@anchor{semantic-ia-fast-mouse-jump}
914@defun semantic-ia-fast-mouse-jump event 874@defun semantic-ia-fast-mouse-jump event
915Jump to the definition for the symbol at the position of the mouse 875Jump to the definition for the symbol at the position of the mouse
916event @var{event}. This command is meant to be bound to a mouse 876event @var{event}. This command is meant to be bound to a mouse
@@ -921,6 +881,10 @@ command, like this:
921@end example 881@end example
922@end defun 882@end defun
923 883
884These commands are often more accurate than than the @code{find-tag}
885command (@pxref{Tags,,,emacs,Emacs manual}), because the Semantic
886Analyzer is context-sensitive.
887
924You can also use @kbd{C-c , j} (@code{semantic-complete-jump-local}) 888You can also use @kbd{C-c , j} (@code{semantic-complete-jump-local})
925and @kbd{C-c , J} (@code{semantic-complete-jump}) to navigate tags. 889and @kbd{C-c , J} (@code{semantic-complete-jump}) to navigate tags.
926@xref{Semantic mode user commands}. Those commands do not make use of 890@xref{Semantic mode user commands}. Those commands do not make use of
@@ -929,15 +893,15 @@ the Semantic Analyzer.
929@node Analyzer Debug 893@node Analyzer Debug
930@subsection Debugging the Semantic Analyzer 894@subsection Debugging the Semantic Analyzer
931 895
932In the event that the Semantic Analyzer does not analyze your code 896If the Semantic Analyzer does not analyze your code properly, you can
933properly, you can take steps to identify and solve the problem. This 897take steps to identify and solve the problem. This section was
934section was written with C/C++ in mind, but should be relevant for any 898written with C/C++ in mind, but should be relevant for any typed
935typed language. 899language.
936 900
937@subsubsection Step 1: Check the context 901@subsubsection Step 1: Check the context
938 902
939The first thing to do is check the current context. You can do this 903To check the current context, type @kbd{M-x
940with @kbd{M-x semantic-analyze-current-context}. 904semantic-analyze-current-context}.
941 905
942@deffn Command semantic-analyze-current-context pos 906@deffn Command semantic-analyze-current-context pos
943Analyze the context at @var{pos}. This function is used by most of 907Analyze the context at @var{pos}. This function is used by most of
@@ -947,10 +911,10 @@ describing the context at @var{pos} (@pxref{Top,,,eieio,EIEIO
947manual}). 911manual}).
948 912
949When called interactively, this displays a @samp{*Semantic Context 913When called interactively, this displays a @samp{*Semantic Context
950Analysis*} buffer in a separate window. This buffer contains a 914Analysis*} buffer containing a summary of the context at point.
951summary of the context at point.
952@end deffn 915@end deffn
953 916
917@noindent
954The Prefix section of the @samp{*Semantic Context Analysis*} buffer 918The Prefix section of the @samp{*Semantic Context Analysis*} buffer
955lists the tags based on the text at point. If it shows only a simple 919lists the tags based on the text at point. If it shows only a simple
956string, the Semantic was unable to identify what the data type was. 920string, the Semantic was unable to identify what the data type was.
@@ -989,21 +953,15 @@ Prefix Types: class Foo @{@}
989 953
990@subsubsection Step 2 : Check your include path 954@subsubsection Step 2 : Check your include path
991 955
992Once you know what symbol can't be found, the next thing to check is 956Once you know the missing symbol, check your include path. The header
993your include path. Is the header or include file that has the 957or include file containing the needed definition may not be in the
994definitions you need actually in the list of headers @semantic{} is 958list of headers @semantic{} is searching through. To get a basic
995searching through? To get a basic list, you can use @kbd{M-x 959list, you can use @kbd{M-x semanticdb-find-test-translate-path}.
996semanticdb-find-test-translate-path}. @xref{Semanticdb search 960@xref{Semanticdb search debugging commands}.
997debugging commands}.
998 961
999For C++, check to make sure that your project level include files are 962If items should be loaded but aren't, or if you see some tables that
1000in quotes, and not angle brackets. Items in angle brackets are system 963have no tags in them, then you you may have an incorrectly-set search
1001includes. 964throttle (@pxref{Search Throttle}). For example,
1002
1003If items should be loaded but aren't, you may need to update the
1004search throttle. @xref{Search Throttle}. If you see some tables that
1005have 0 tags in them, then you you may have an incorrectly set
1006throttle. For example,
1007 965
1008@example 966@example
1009*#<semanticdb-table main.cpp (4 tags DIRTY)> 967*#<semanticdb-table main.cpp (4 tags DIRTY)>
@@ -1011,9 +969,13 @@ throttle. For example,
1011@end example 969@end example
1012 970
1013Here, @semantic{} found @file{foo.hh}, but there are 0 tags. This may 971Here, @semantic{} found @file{foo.hh}, but there are 0 tags. This may
1014be because the throttle was set to not read in and parse files that 972be because you had set the throttle to avoid reading and parsing files
1015Emacs has not yet loaded in. To fix this case, visit the file, and 973that Emacs has not visited. To fix this, visit the file and let
1016let @semantic{} parse and save the tags table. 974@semantic{} parse it.
975
976For C++, check also that the @samp{#include} statements for your
977project-level files use quotes, not angle brackets; angle brackets are
978for system files.
1017 979
1018@subsubsection Step 3: Check the local scope 980@subsubsection Step 3: Check the local scope
1019 981
@@ -1080,7 +1042,7 @@ contain all the datatypes in all included header files.
1080The @code{dependants} slot will specify other files that depend on 1042The @code{dependants} slot will specify other files that depend on
1081this one. 1043this one.
1082 1044
1083@section Step 5: Check the parser 1045@subsubsection Step 5: Check the parser
1084 1046
1085Go to the location where your unfound tag should be. You can call 1047Go to the location where your unfound tag should be. You can call
1086@kbd{M-x bovinate}, and see a dump of the raw tag structure. To see a 1048@kbd{M-x bovinate}, and see a dump of the raw tag structure. To see a
@@ -1104,6 +1066,271 @@ to account for it.
1104Or perhaps the parser needs to be fixed. 1066Or perhaps the parser needs to be fixed.
1105@end enumerate 1067@end enumerate
1106 1068
1069@node Speedbar
1070@section Speedbar
1071@cindex speedbar
1072
1073You can integrate @semantic{} with the Speedbar.
1074@xref{Speedbar,,,emacs,Emacs manual}. To do this, add the following
1075line to your init file:
1076
1077@example
1078(add-hook 'speedbar-load-hook (lambda () (require 'semantic/sb)))
1079@end example
1080
1081@noindent
1082Or, alternatively:
1083
1084@example
1085(require 'semantic/sb)
1086@end example
1087
1088Once installed, the Speedbar will use @semantic{} to find and display
1089tags. Tags from @semantic{} are displayed with more details than
1090ordinary Speedbar tags, such as function arguments and return type.
1091
1092In addition, you can use the Speedbar to show the output of the
1093Semantic Analyzer (@pxref{Analyzer}). To do this, go to the
1094@samp{Display} menu item on the Speedbar menu and select
1095@samp{Analyze}; or type @kbd{M-x semantic-speedbar-analysis}.
1096
1097@deffn Command semantic-speedbar-analysis
1098Start the Speedbar in Semantic Analysis mode.
1099@end deffn
1100
1101In Semantic Analysis mode, the Speedbar displays information about the
1102local context, such as the current function, local arguments and
1103variables, and details on the prefix (the current symbol). Each entry
1104has an @samp{<i>} button; clicking on this shows a summary of what
1105@semantic{} knows about that variable or type. The Speedbar also
1106displays a list of possible completions at point.
1107
1108@node SymRef
1109@section Symbol References
1110@cindex symref
1111
1112@semantic{} can interface with external @dfn{symbol reference tools},
1113such as GNU Global and GNU Idutils. These tools provide information
1114about where different tags or symbols appear.
1115
1116By default, @semantic{} tries to look for the best external symbol
1117reference tool that can be used. The supported tools are GNU Global,
1118GNU Idutils, CScope, and Grep (the fallback method). For best
1119results, use GNU Global. However, @semantic{} does not manage your
1120GNU Global tables for you; you must manage them yourself.
1121
1122@defvar semantic-symref-tool
1123The value of this variable is a symbol that determines the external
1124symbol reference tool to use. The default value, @code{detect}, says
1125to look for the best available tool. Other possible values are
1126@code{global}, @code{idutils}, @code{cscope}, and @code{grep}. Note
1127that @code{grep} is much slower than the others.
1128@end defvar
1129
1130The commands to display symbol references are @kbd{C-c , g}
1131(@code{semantic-symref-symbol} and @kbd{C-c , G}
1132(@code{semantic-symref}). These keybindings are available whenever
1133Semantic mode is enabled (@pxref{Semantic mode user commands}).
1134
1135@deffn Command semantic-symref-symbol sym
1136This command (normally bound to @kbd{C-c , g}) prompts for a symbol
1137name, and uses an external reference tool to find references to that
1138tag.
1139@end deffn
1140
1141@deffn Command semantic-symref
1142This command (normally bound to @kbd{C-c , G}) uses an external
1143reference tool to find references to the current tag.
1144@end deffn
1145
1146Both @code{semantic-symref-symbol} and @code{semantic-symref} display
1147a list of symbol references in a separate buffer. The entries are
1148organized by file, and by function name. Typing @key{RET} on the
1149@samp{[+]} next to each function name ``expands'' that entry, listing
1150all references to the target symbol occurring within that function.
1151Typing @kbd{RET} on a reference line jumps to that reference.
1152
1153@node MRU Bookmarks
1154@section MRU Bookmarks mode
1155@cindex semantic-mru-bookmark-mode
1156
1157Semantic MRU Bookmarks mode is a minor mode that keeps track of the
1158tags you have edited, allowing you to quickly return to them later
1159(MRU stands for ``Most Recently Used'').
1160
1161@deffn Command global-semantic-mru-bookmark-mode &optional arg
1162Toggle Semantic MRU Bookmarks mode globally. The minor mode can be
1163turned on only if the current buffer was set up for parsing. With
1164argument @var{arg}, turn the minor mode if @var{arg} is positive, and
1165off otherwise.
1166@end deffn
1167
1168Semantic MRU Bookmarks mode takes note of each tag you edit.
1169Afterwards, you can type @kbd{C-x B}
1170(@code{semantic-mrub-switch-tags}) to return to a tag. This command
1171prompts for a tag name, completing with the names of edited tags; at
1172the prompt, you can use @kbd{M-p} and @kbd{M-n} to cycle through tags
1173in order of last modification time.
1174
1175@node Sticky Func Mode
1176@section Sticky Function mode
1177
1178Semantic Sticky Function minor mode displays a header line that shows
1179the declaration line of the function or tag on the topmost line in the
1180text area. This allows you to keep that declaration line in view at
1181all times, even if it is scrolls off the ``top'' of the screen.
1182
1183In addition, clicking @kbd{Mouse-1} on the header line opens a context
1184menu that contains menu items for copying, killing, or narrowing to
1185that tag.
1186
1187@deffn Command global-semantic-stickyfunc-mode &optional arg
1188Toggle Semantic Sticky Function mode in all Semantic-enabled buffers.
1189With an optional argument @var{arg}, enable if @var{arg} is positive,
1190and disable otherwise.
1191@end deffn
1192
1193@defvar semantic-stickyfunc-sticky-classes
1194The value of this variable is a list of tag classes that Semantic
1195Sticky Function mode makes ``sticky''. The default is
1196@code{'(function type)}, meaning function declarations and type
1197declarations. Other possible tag classes are @code{variable},
1198@code{include}, and @code{package}.
1199@end defvar
1200
1201@node Highlight Func Mode
1202@section Highlight Func Mode
1203@cindex semantic-highlight-func-mode
1204
1205Semantic Highlight Function minor mode highlights the declaration line
1206of the current function or tag (that is to say, the first line that
1207describes the rest of the construct).
1208
1209In addition, clicking @kbd{Mouse-3} on the highlighted declaration
1210line opens a context menu that contains menu items for copying,
1211killing, or narrowing to that tag.
1212
1213The tag classes highlighted by Semantic Highlight Function mode are
1214the same ones given by @code{semantic-stickyfunc-sticky-classes}.
1215@xref{Sticky Func Mode}.
1216
1217@defun global-semantic-highlight-func-mode &optional arg
1218Toggle Semantic Highlight Function mode in all Semantic-enabled
1219buffers. With an optional argument @var{arg}, enable if @var{arg} is
1220positive, and disable otherwise.
1221@end defun
1222
1223@deffn Face semantic-highlight-func-current-tag-face
1224This face is used to highlight declaration lines in Semantic Highlight
1225Func mode.
1226@end deffn
1227
1228@node Tag Decoration Mode
1229@section Tag Decoration Mode
1230@cindex semantic-decoration-mode
1231
1232Semantic Tag Decoration mode ``decorates'' each tag based on certain
1233arbitrary features of that tag. Decorations are specified using the
1234variable @code{semantic-decoration-styles}.
1235
1236@deffn Command global-semantic-decoration-mode &optional arg
1237Toggle Semantic Tag Decoration mode in all Semantic-enabled buffers.
1238With an optional argument @var{arg}, enable if @var{arg} is positive,
1239and disable otherwise.
1240@end deffn
1241
1242@defvar semantic-decoration-styles
1243The value of this variable is a list of decoration styles for Semantic
1244Tag Decoration mode. Each element in this list should have the form
1245@code{(@var{name} . @var{flag})}, where @var{name} is a style name (a
1246symbol) and @var{flag} is non-@code{nil} if the style is enabled.
1247
1248The following styles are available:
1249
1250@table @code
1251@item semantic-tag-boundary
1252Place an overline in front of each long tag (excluding prototypes).
1253
1254@item semantic-decoration-on-private-members
1255Highlight class members that are designated as private.
1256
1257@item semantic-decoration-on-protected-members
1258Highlight class members that are designated as protected.
1259
1260@item semantic-decoration-on-includes
1261Highlight class members that are includes. Clicking on the
1262highlighted include statements opens a context menu for configuring
1263@semantic{} includes.
1264@end table
1265@end defvar
1266
1267To enable or disable specific decorations, use this function:
1268
1269@deffn Command semantic-toggle-decoration-style name &optional arg
1270Prompt for a decoration style, @var{name}, and turn it on or off.
1271With prefix argument @var{arg}, turn on if positive, otherwise off.
1272Return non-@code{nil} if the decoration style is enabled.
1273@end deffn
1274
1275@deffn Face semantic-tag-boundary-face
1276Face for long tags in the @code{semantic-tag-boundary} decoration
1277style.
1278@end deffn
1279
1280@deffn Face semantic-decoration-on-private-members-face
1281Face for privately-scoped tags in the
1282@code{semantic-decoration-on-private-members} decoration style.
1283@end deffn
1284
1285@deffn Face semantic-decoration-on-protected-members-face
1286Face for protected tags in the
1287@code{semantic-decoration-on-protected-members} decoration style.
1288@end deffn
1289
1290@deffn Face semantic-decoration-on-includes
1291Face for includes that are not in some other state, in the
1292@code{semantic-decoration-on-includes} decoration style.
1293@end deffn
1294
1295@deffn Face semantic-decoration-on-unknown-includes
1296Face for includes that cannot be found, in the
1297@code{semantic-decoration-on-includes} decoration style.
1298@end deffn
1299
1300@deffn Face semantic-decoration-on-unparsed-includes
1301Face for includes that have not yet been parsed, in the
1302@code{semantic-decoration-on-includes} decoration style.
1303@end deffn
1304
1305@subsection Creating New Decoration Modes
1306
1307You can create new types of decorations using the following function:
1308
1309@defun define-semantic-decoration-style name doc &rest flags
1310Define a new decoration style with @var{name}.
1311@var{doc} is a documentation string describing the decoration style @var{name}.
1312It is appended to auto-generated doc strings.
1313An Optional list of @var{flags} can also be specified. Flags are:
1314 @code{:enabled} <value> - specify the default enabled value for @var{name}.
1315
1316
1317This defines two new overload functions respectively called @code{NAME-p}
1318and @code{NAME-highlight}, for which you must provide a default
1319implementation in respectively the functions @code{NAME-p-default} and
1320@code{NAME-highlight-default}. Those functions are passed a tag. @code{NAME-p}
1321must return non-@code{nil} to indicate that the tag should be decorated by
1322@code{NAME-highlight}.
1323
1324To put primary decorations on a tag @code{NAME-highlight}, use
1325functions like @dfn{semantic-set-tag-face},
1326@dfn{semantic-set-tag-intangible}, etc., found in the
1327semantic-decorate library.
1328
1329To add other kind of decorations on a tag, @code{NAME-highlight} must use
1330@dfn{semantic-decorate-tag}, and other functions of the semantic
1331decoration @var{api} found in this library.
1332@end defun
1333
1107@ignore 1334@ignore
1108 arch-tag: 760dca58-7119-484e-8237-866cbaf36f79 1335 arch-tag: 760dca58-7119-484e-8237-866cbaf36f79
1109@end ignore 1336@end ignore
diff --git a/doc/misc/semantic.texi b/doc/misc/semantic.texi
index 17ec5d12fcc..547fd6958d0 100644
--- a/doc/misc/semantic.texi
+++ b/doc/misc/semantic.texi
@@ -153,8 +153,8 @@ distributed along with @semantic{}.
153 +---------------+ | COMMON | | COMMON |<--- SPEEDBAR 153 +---------------+ | COMMON | | COMMON |<--- SPEEDBAR
154 Java --->| JAVA PARSER |--->| PARSE | | | 154 Java --->| JAVA PARSER |--->| PARSE | | |
155 +---------------+ | TREE | | PARSE |<--- SEMANTICDB 155 +---------------+ | TREE | | PARSE |<--- SEMANTICDB
156 +---------------+ | FORMAT | | API |<--- ecb 156 +---------------+ | FORMAT | | API |
157 Scheme --->| SCHEME PARSER |--->| | | | 157 Scheme --->| SCHEME PARSER |--->| | | |<--- ecb
158 +---------------+ | | | | 158 +---------------+ | | | |
159 +---------------+ | | | | 159 +---------------+ | | | |
160 Texinfo --->| TEXI. PARSER |--->| | | | 160 Texinfo --->| TEXI. PARSER |--->| | | |
@@ -162,15 +162,6 @@ distributed along with @semantic{}.
162 162
163 ... ... ... ... 163 ... ... ... ...
164 164
165 +---------------+ | | | |<--- app. 1
166 Lang. A --->| A Parser |--->| | | |
167 +---------------+ | | | |<--- app. 2
168 +---------------+ | | | |
169 Lang. B --->| B Parser |--->| | | |<--- app. 3
170 +---------------+ | | | |
171
172 ... ... ... ... ...
173
174 +---------------+ | | | | 165 +---------------+ | | | |
175 Lang. Y --->| Y Parser |--->| | | |<--- app. ? 166 Lang. Y --->| Y Parser |--->| | | |<--- app. ?
176 +---------------+ | | | | 167 +---------------+ | | | |
@@ -231,11 +222,9 @@ time. @xref{SemanticDB}.
231@chapter Semantic Internals 222@chapter Semantic Internals
232 223
233This chapter provides an overview of the internals of @semantic{}. 224This chapter provides an overview of the internals of @semantic{}.
234This information would not be needed by neither application developers 225This information is usually not needed by application developers or
235nor grammar developers. 226grammar developers; it is useful mostly for the hackers who would like
236 227to learn more about how @semantic{} works.
237It would be useful mostly for the hackers who would like to learn
238more about how @semantic{} works.
239 228
240@menu 229@menu
241* Parser code :: Code used for the parsers 230* Parser code :: Code used for the parsers