diff options
| author | Chong Yidong | 2009-12-14 04:11:43 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-12-14 04:11:43 +0000 |
| commit | 8e6874337fd3451534f1f02a507fe8ead9aae177 (patch) | |
| tree | e345d8a4fab3e245b71d54e88d7257b878901b47 /doc | |
| parent | a0cefee5c19d08b65d100d8fbf200b7159391548 (diff) | |
| download | emacs-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/ChangeLog | 11 | ||||
| -rw-r--r-- | doc/misc/sem-user.texi | 479 | ||||
| -rw-r--r-- | doc/misc/semantic.texi | 21 |
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 @@ | |||
| 1 | 2009-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 | |||
| 1 | 2009-12-09 Michael Albinus <michael.albinus@gmx.de> | 12 | 2009-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 | ||
| 13 | You can begin using @semantic{} by enabling Semantic mode, a global | 13 | You can begin using @semantic{} by enabling Semantic mode, a global |
| 14 | minor mode: type @kbd{M-x semantic-mode}, or click on the @samp{Source | 14 | minor mode: type @kbd{M-x semantic-mode}, or open the @samp{Tools} |
| 15 | Code Parsers (Semantic)} menu item in the @samp{Tools} menu. | 15 | menu and click on the menu item named @samp{Source Code Parsers |
| 16 | (Semantic)}. @xref{Semantic mode}. | ||
| 16 | 17 | ||
| 17 | When Semantic mode is turned on, Emacs automatically parses each file | 18 | When Semantic mode is turned on, Emacs automatically parses each file |
| 18 | you visit. This allows you to use @semantic{} user commands in those | 19 | you visit. You can then use @semantic{} user commands in those |
| 19 | buffers. It also enables a number of ``helper'' minor modes for | 20 | buffers (@pxref{Semantic mode user commands}). You can also choose to |
| 20 | saving tags, displaying tag information, and so forth. @xref{Semantic | 21 | enable a number of ``helper'' minor modes for saving tags, displaying |
| 21 | mode}. | 22 | tag information, and so forth. |
| 22 | 23 | ||
| 23 | To enable Semantic mode each time you start Emacs, add the line | 24 | To 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 |
| 25 | File,,,emacs,Emacs manual}. | 26 | File,,,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}. | |||
| 38 | Semantic mode is a global minor mode for @semantic{} as a whole. When | 45 | Semantic mode is a global minor mode for @semantic{} as a whole. When |
| 39 | enabled, each file you visit is automatically parsed, provided its | 46 | enabled, each file you visit is automatically parsed, provided its |
| 40 | major mode is specified in the variable | 47 | major 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 |
| 42 | every buffer @semantic{} knows how to parse). | 49 | variable sets up parsing for all the parsers included with Emacs, but |
| 50 | you may add to it if you install additional parsers). | ||
| 43 | 51 | ||
| 44 | In each parser-enabled buffer, a number of @semantic{} commands are | 52 | In each parser-enabled buffer, a number of @semantic{} commands are |
| 45 | available for navigating, querying, and editing source code. | 53 | available for navigating, querying, and editing source code. |
| @@ -48,14 +56,13 @@ installs a @samp{Development} menu on the menu-bar, with many of these | |||
| 48 | commands. | 56 | commands. |
| 49 | 57 | ||
| 50 | In addition, enabling Semantic mode turns on certain auxiliary global | 58 | In addition, enabling Semantic mode turns on certain auxiliary global |
| 51 | minor modes, as specified by the variable | 59 | minor modes. The variable @code{semantic-default-submodes} determines |
| 52 | @code{semantic-default-submodes}. The default auxiliary modes are | 60 | which auxiliary modes are enabled; the defaults are SemanticDB mode |
| 53 | SemanticDB mode (@pxref{SemanticDB}) and Global Semantic Idle | 61 | (@pxref{SemanticDB}) and Global Semantic Idle Scheduler mode |
| 54 | Scheduler mode (@pxref{Idle Scheduler}). You can also toggle the | 62 | (@pxref{Idle Scheduler}). You can also toggle the auxiliary minor |
| 55 | auxiliary minor modes separately, using their mode functions | 63 | modes separately, using their mode functions (e.g. @kbd{M-x |
| 56 | (e.g. @kbd{M-x semanticdb-minor-mode}), or via the @samp{Development} | 64 | semanticdb-minor-mode}), or via the @samp{Development} menu. The |
| 57 | menu. These auxiliary minor modes are described in the following | 65 | various auxiliary minor modes are described in the following sections. |
| 58 | sections. | ||
| 59 | 66 | ||
| 60 | @defvar semantic-new-buffer-setup-functions | 67 | @defvar semantic-new-buffer-setup-functions |
| 61 | The value of this variable is an alist of functions to call for | 68 | The 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 | |||
| 78 | valid mode symbols are: | 85 | valid 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 |
| 125 | Prompt for a tag, and display a list of tags that call it | 132 | Prompt 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 |
| 134 | external symbol reference tool. @xref{SymRef}. | ||
| 127 | 135 | ||
| 128 | @item C-c , G | 136 | @item C-c , G |
| 129 | Display a list of tags that call the current tag | 137 | Display 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 |
| 139 | symbol reference tool. @xref{SymRef}. | ||
| 131 | 140 | ||
| 132 | @item C-c , p | 141 | @item C-c , p |
| 133 | Move point to the previous tag (@code{senator-previous-tag}). | 142 | Move point to the previous tag (@code{senator-previous-tag}). |
| @@ -226,7 +235,6 @@ want to create it. | |||
| 226 | You can change the name of the SemanticDB directory by customizing the | 235 | You can change the name of the SemanticDB directory by customizing the |
| 227 | variable @code{semanticdb-default-save-directory}. | 236 | variable @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 |
| 231 | The name of the directory where SemanticDB cache files are saved. If | 239 | The name of the directory where SemanticDB cache files are saved. If |
| 232 | the value is @code{nil}, SemanticDB saves its data into a single file, | 240 | the 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 |
| 239 | The name of a cache file in which to save SemanticDB, when | 246 | The 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 | |||
| 244 | suppress saving altogether, by customizing | 251 | suppress 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 |
| 249 | List of valid paths for SemanticDB to cache. Each element should be a | 255 | List of valid paths for SemanticDB to cache. Each element should be a |
| 250 | directory name (a string); then the parse data from any file in that | 256 | directory name (a string); then the parse data from any file in that |
| @@ -260,7 +266,6 @@ saving directory based on the variable | |||
| 260 | The default value is @code{(always)}. | 266 | The 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 |
| 265 | The value of this variable is a list of predicates for indicating that | 270 | The value of this variable is a list of predicates for indicating that |
| 266 | a directory belongs to a project. This list is used when the value of | 271 | a 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 | |||
| 273 | controlled by them. | 278 | controlled 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 |
| 278 | Abnormal hook run after a database is saved. Each function is called | 282 | Abnormal hook run after a database is saved. Each function is called |
| 279 | with one argument, the object representing the database recently | 283 | with one argument, the object representing the database recently |
| @@ -303,9 +307,9 @@ based on whether the @code{#include} directive uses the @code{""} or | |||
| 303 | the @dfn{system include path} (@pxref{Include paths}). | 307 | the @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 |
| 333 | The default throttle for @code{semanticdb-find} routines. | 336 | The default throttle for @code{semanticdb-find} routines. |
| 334 | The throttle controls how detailed the list of database | 337 | The 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 | |||
| 377 | automatically. @xref{Top,,,ede,EDE manual}. You can also specify | 380 | automatically. @xref{Top,,,ede,EDE manual}. You can also specify |
| 378 | them yourself. | 381 | them yourself. |
| 379 | 382 | ||
| 380 | @anchor{semanticdb-project-roots} | ||
| 381 | @deffn Option semanticdb-project-roots | 383 | @deffn Option semanticdb-project-roots |
| 382 | The value of this variable is a list of directories (strings) that are | 384 | The value of this variable is a list of directories (strings) that are |
| 383 | project roots. All subdirectories of a project root are considered | 385 | project 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 |
| 390 | The value of this variable is a list of functions to determine a given | 391 | The value of this variable is a list of functions to determine a given |
| 391 | directory's project root. These functions are called, one at a time, | 392 | directory's project root. These functions are called, one at a time, |
| @@ -406,26 +407,22 @@ subdirectories on Unix-like operating systems. | |||
| 406 | You can add and remove system include paths using the following | 407 | You can add and remove system include paths using the following |
| 407 | commands: | 408 | commands: |
| 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 |
| 411 | Prompts for a directory, @var{dir}, and add it as a system include | 411 | Prompts for a directory, @var{dir}, and add it as a system include |
| 412 | path for the current major mode. When called non-interactively, the | 412 | path for the current major mode. When called non-interactively, the |
| 413 | major mode can be specified with the @var{mode} argument. | 413 | major 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 |
| 418 | Prompt for a directory, @var{dir}, and remove it from the system | 417 | Prompt for a directory, @var{dir}, and remove it from the system |
| 419 | include path for the current major mode (or @var{mode}). | 418 | include 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 |
| 424 | Customize the system include path for the current major mode (or | 422 | Customize 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 |
| 430 | Include tags implied for all files of a given mode. You can set this | 427 | Include tags implied for all files of a given mode. You can set this |
| 431 | variable with @code{defvar-mode-local} for a particular mode so that | 428 | variable 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 | |||
| 446 | semanticdb-find-adebug-lost-includes}. | 443 | semanticdb-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} | ||
| 450 | Dump a list of all databases in Emacs memory. | 446 | Dump 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 |
| 455 | Call and output results of @dfn{semanticdb-find-translate-path}. In | 450 | Call and output results of @dfn{semanticdb-find-translate-path}. In |
| 456 | the displayed buffer, you can type @key{SPC} to expand items. With | 451 | the 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} | ||
| 462 | Translate the current path, then display the lost includes. | 456 | Translate the current path, then display the lost includes. |
| 463 | Examines the variable @code{semanticdb-find-lost-includes}. | 457 | Examines 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}. | |||
| 466 | Lastly, you can test an explicit search term using this command: | 460 | Lastly, 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} | ||
| 470 | Search the semanticdb for @var{regex} for the current buffer. | 463 | Search the semanticdb for @var{regex} for the current buffer. |
| 471 | Display the results as a debug list. | 464 | Display 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 | |||
| 482 | could write a new database backend that stores tags into a database, | 475 | could write a new database backend that stores tags into a database, |
| 483 | or other storage system. | 476 | or other storage system. |
| 484 | 477 | ||
| 485 | @anchor{semanticdb-new-database-class} | ||
| 486 | @defvar semanticdb-new-database-class | 478 | @defvar semanticdb-new-database-class |
| 487 | The default type of database created for new files. This can be | 479 | The default type of database created for new files. This can be |
| 488 | changed on a per file basis, so that some directories are saved using | 480 | changed 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 | |||
| 498 | summary-mode, or the analyzer. | 490 | summary-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} | ||
| 502 | Create an @var{ebrowse} database for directory @var{dir}. | 493 | Create an @var{ebrowse} database for directory @var{dir}. |
| 503 | The database file is stored in ~/.semanticdb, or whichever directory | 494 | The database file is stored in ~/.semanticdb, or whichever directory |
| 504 | is specified by @code{semanticdb-default-system-save-directory}. | 495 | is 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 | ||
| 511 | The @dfn{Semantic idle scheduler} is a part of @semantic{} that | 502 | The @dfn{Semantic Idle Scheduler} is a part of @semantic{} that |
| 512 | performs various operations while Emacs is waiting for user input | 503 | performs 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 |
| 514 | also used for other purposes, such as displaying information about | 505 | time. You can also use the Idle Scheduler to display function |
| 515 | tags. | 506 | prototypes (@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 |
| 519 | This command toggles Semantic Idle Scheduler mode in every | 510 | This 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 | |||
| 525 | Mode}). | 516 | Mode}). |
| 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 |
| 530 | The value of this variable is the amount of idle time, in seconds, | 520 | The value of this variable is the amount of idle time, in seconds, |
| 531 | before the Semantic idle scheduler activates. The default is 1. | 521 | before 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 |
| 536 | If this variable is non-@code{nil}, the idle scheduler prints verbose | 525 | If this variable is non-@code{nil}, the idle scheduler prints verbose |
| 537 | messages while running, which are useful for debugging. | 526 | messages 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 | |||
| 552 | automatically reparses all buffers that need it. Any arriving user | 541 | automatically reparses all buffers that need it. Any arriving user |
| 553 | input cancels this, returning Emacs to its normal editing behavior. | 542 | input 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 |
| 557 | Maximum size in bytes of buffers automatically reparsed. If this | 545 | Maximum size in bytes of buffers automatically reparsed. If this |
| 558 | value is less than or equal to @var{0}, buffers are automatically | 546 | value is less than or equal to @var{0}, buffers are automatically |
| 559 | reparsed regardless of their size. | 547 | reparsed 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 |
| 564 | If non-@code{nil}, disable display of working messages whie reparsing. | 551 | If 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 |
| 569 | If non-@code{nil}, show working messages in the mode line. Normally, | 555 | If non-@code{nil}, show working messages in the mode line. Normally, |
| 570 | re-parsing shows messages in the minibuffer; this moves the parse | 556 | re-parsing shows messages in the minibuffer; this moves the parse |
| 571 | message to the modeline instead. | 557 | message 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 |
| 576 | This normal hook is run just before the idle scheduler begins | 561 | This normal hook is run just before the idle scheduler begins |
| 577 | reparsing. If any hook function throws an error, the value of this | 562 | reparsing. 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 | |||
| 579 | lexical errors. | 564 | lexical 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 | ||
| 585 | This normal hook is run after the idle scheduler finishes reparsing. | 569 | This 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 | |||
| 609 | out after a longer idle delay. The following features control how the | 593 | out after a longer idle delay. The following features control how the |
| 610 | idle work is performed. | 594 | idle 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 |
| 614 | The value of this variable is the amount of idle time, in seconds, | 597 | The value of this variable is the amount of idle time, in seconds, |
| 615 | before commencing idle work. The default is 60. | 598 | before 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 |
| 620 | If the value of this variable is non-@code{nil}, the Semantic idle | 602 | If the value of this variable is non-@code{nil}, the Semantic idle |
| 621 | scheduler uses idle work time to parse files in the same directory as | 603 | scheduler 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 | |||
| 633 | debugger. Instead, use the following commands to debug the error: | 615 | debugger. 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} | ||
| 637 | Run the Semantic idle function with debugging turned on. | 618 | Run 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} | ||
| 642 | Run the Semantic idle work function with debugging turned on. | 622 | Run 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 | |||
| 650 | echo area. Its functionality is similar to what ElDoc mode provides | 630 | echo area. Its functionality is similar to what ElDoc mode provides |
| 651 | for Emacs Lisp (@pxref{Lisp Doc,,,emacs,Emacs manual}). | 631 | for 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 |
| 656 | This command toggles Semantic Idle Summary mode in all | 634 | This 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} | |||
| 666 | You can override the method for getting the current tag to display by | 644 | You can override the method for getting the current tag to display by |
| 667 | setting @code{idle-summary-current-symbol-info}. | 645 | setting @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 |
| 671 | The value of this variable should be a function to call to display tag | 648 | The value of this variable should be a function to call to display tag |
| 672 | information during idle time. See the variable | 649 | information 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 |
| 678 | The value of this variable is a list of font-lock faces indicating | 654 | The value of this variable is a list of font-lock faces indicating |
| 679 | useless summary contexts. These are generally faces used to highlight | 655 | useless summary contexts. These are generally faces used to highlight |
| @@ -692,8 +668,6 @@ different alternatives. | |||
| 692 | Semantic Idle Completions mode performs completion based on the | 668 | Semantic Idle Completions mode performs completion based on the |
| 693 | Semantic Analyzer (@pxref{Analyzer}). | 669 | Semantic 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 |
| 698 | This command toggles Semantic Idle Completions mode in every | 672 | This 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}). | |||
| 743 | You can also exit inline completion by issuing any other Emacs | 717 | You can also exit inline completion by issuing any other Emacs |
| 744 | command. The completion text then disappears from the buffer. | 718 | command. 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 |
| 748 | This is the command for performing inline code completion. It is | 721 | This is the command for performing inline code completion. It is |
| 749 | called by Semantic Idle Completions mode during idle time, but you can | 722 | called 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 | |||
| 751 | a state for inline completion. | 724 | a 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 |
| 756 | The value of this variable determines how | 728 | The 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 | ||
| 791 | The Semantic Analyzer can be used to perform code completion in a | 763 | The Semantic Analyzer can be used to perform code completion in a |
| 792 | manner that takes the local context into account. | 764 | manner that takes the local context into account. (In addition to the |
| 793 | 765 | user commands in this section, Semantic Idle Completions mode also | |
| 794 | In addition to the user commands documented in this section, the | 766 | uses the Semantic Analyzer. @xref{Idle Completions Mode}.) |
| 795 | completions performed by Semantic Idle Completions mode also uses the | ||
| 796 | Semantic Analyzer. @xref{Idle Completions Mode}. | ||
| 797 | 767 | ||
| 798 | @deffn Command semantic-analyze-possible-completions context | 768 | @deffn Command semantic-analyze-possible-completions context |
| 799 | This is the most basic command for Semantic Analyzer-based completion. | 769 | This is the most basic command for Semantic Analyzer-based completion. |
| 800 | Called interactively, it displays in another window a list of the | 770 | Called interactively, it displays a list of the possible completions |
| 801 | possible completions for the symbol at point. | 771 | for the symbol at point. |
| 802 | 772 | ||
| 803 | When called from a Lisp program, | 773 | When 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 |
| 823 | This command is bound to @kbd{C-c , @key{SPC}} when Semantic mode is | 792 | This command is bound to @kbd{C-c , @key{SPC}} when Semantic mode is |
| 824 | enabled (@pxref{Semantic mode user commands}). It displays a list of | 793 | enabled (@pxref{Semantic mode user commands}). It displays a list of |
| @@ -836,7 +805,6 @@ explicitly, whereas Semantic Idle Completions mode completes during | |||
| 836 | idle time (@pxref{Idle Completions Mode}). | 805 | idle 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 |
| 841 | The value of this variable determines how | 809 | The 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 | |||
| 860 | the simpler command @code{semantic-ia-complete-symbol point}. This | 828 | the simpler command @code{semantic-ia-complete-symbol point}. This |
| 861 | behaves like the usual @kbd{M-@key{TAB}} (@code{complete-symbol}) | 829 | behaves like the usual @kbd{M-@key{TAB}} (@code{complete-symbol}) |
| 862 | command (@pxref{Symbol Completion,,,emacs,Emacs manual}), except it | 830 | command (@pxref{Symbol Completion,,,emacs,Emacs manual}), except it |
| 863 | uses Semantic Analyzer. | 831 | uses 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 |
| 867 | Complete the current symbol at @var{point}. | 834 | Complete 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 | ||
| 873 | You can use the commands in this section to find information about the | 840 | You can use the following commands to obtain information about the |
| 874 | code at point: | 841 | code 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 |
| 878 | Display a summary for the symbol at @var{pos}. Called interactively, | 844 | Display 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 |
| 884 | Display the code-level documentation for the symbol at @var{pos}. | 849 | Display the code-level documentation for the symbol at @var{pos}. |
| 885 | Called interactively, @var{pos} defaults to point. | 850 | Called 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 |
| 890 | Prompt for the name of a data type, @var{typename}, and display its | 854 | Prompt for the name of a data type, @var{typename}, and display its |
| 891 | components. For instance, if the type in question is a class, this | 855 | components. 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 | ||
| 902 | The Semantic Analyzer can be used to jump directly to the definition | 866 | The Semantic Analyzer can be used to jump directly to the definition |
| 903 | for a code symbol. Because it is based on code analysis, its behavior | 867 | for a code symbol. |
| 904 | is 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 |
| 909 | Jump to the definition for the symbol at @var{pos}. Called | 870 | Jump to the definition for the symbol at @var{pos}. Called |
| 910 | interactively, @var{pos} defaults to point. | 871 | interactively, @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 |
| 915 | Jump to the definition for the symbol at the position of the mouse | 875 | Jump to the definition for the symbol at the position of the mouse |
| 916 | event @var{event}. This command is meant to be bound to a mouse | 876 | event @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 | ||
| 884 | These commands are often more accurate than than the @code{find-tag} | ||
| 885 | command (@pxref{Tags,,,emacs,Emacs manual}), because the Semantic | ||
| 886 | Analyzer is context-sensitive. | ||
| 887 | |||
| 924 | You can also use @kbd{C-c , j} (@code{semantic-complete-jump-local}) | 888 | You can also use @kbd{C-c , j} (@code{semantic-complete-jump-local}) |
| 925 | and @kbd{C-c , J} (@code{semantic-complete-jump}) to navigate tags. | 889 | and @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 | ||
| 932 | In the event that the Semantic Analyzer does not analyze your code | 896 | If the Semantic Analyzer does not analyze your code properly, you can |
| 933 | properly, you can take steps to identify and solve the problem. This | 897 | take steps to identify and solve the problem. This section was |
| 934 | section was written with C/C++ in mind, but should be relevant for any | 898 | written with C/C++ in mind, but should be relevant for any typed |
| 935 | typed language. | 899 | language. |
| 936 | 900 | ||
| 937 | @subsubsection Step 1: Check the context | 901 | @subsubsection Step 1: Check the context |
| 938 | 902 | ||
| 939 | The first thing to do is check the current context. You can do this | 903 | To check the current context, type @kbd{M-x |
| 940 | with @kbd{M-x semantic-analyze-current-context}. | 904 | semantic-analyze-current-context}. |
| 941 | 905 | ||
| 942 | @deffn Command semantic-analyze-current-context pos | 906 | @deffn Command semantic-analyze-current-context pos |
| 943 | Analyze the context at @var{pos}. This function is used by most of | 907 | Analyze 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 | |||
| 947 | manual}). | 911 | manual}). |
| 948 | 912 | ||
| 949 | When called interactively, this displays a @samp{*Semantic Context | 913 | When called interactively, this displays a @samp{*Semantic Context |
| 950 | Analysis*} buffer in a separate window. This buffer contains a | 914 | Analysis*} buffer containing a summary of the context at point. |
| 951 | summary of the context at point. | ||
| 952 | @end deffn | 915 | @end deffn |
| 953 | 916 | ||
| 917 | @noindent | ||
| 954 | The Prefix section of the @samp{*Semantic Context Analysis*} buffer | 918 | The Prefix section of the @samp{*Semantic Context Analysis*} buffer |
| 955 | lists the tags based on the text at point. If it shows only a simple | 919 | lists the tags based on the text at point. If it shows only a simple |
| 956 | string, the Semantic was unable to identify what the data type was. | 920 | string, 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 | ||
| 992 | Once you know what symbol can't be found, the next thing to check is | 956 | Once you know the missing symbol, check your include path. The header |
| 993 | your include path. Is the header or include file that has the | 957 | or include file containing the needed definition may not be in the |
| 994 | definitions you need actually in the list of headers @semantic{} is | 958 | list of headers @semantic{} is searching through. To get a basic |
| 995 | searching through? To get a basic list, you can use @kbd{M-x | 959 | list, you can use @kbd{M-x semanticdb-find-test-translate-path}. |
| 996 | semanticdb-find-test-translate-path}. @xref{Semanticdb search | 960 | @xref{Semanticdb search debugging commands}. |
| 997 | debugging commands}. | ||
| 998 | 961 | ||
| 999 | For C++, check to make sure that your project level include files are | 962 | If items should be loaded but aren't, or if you see some tables that |
| 1000 | in quotes, and not angle brackets. Items in angle brackets are system | 963 | have no tags in them, then you you may have an incorrectly-set search |
| 1001 | includes. | 964 | throttle (@pxref{Search Throttle}). For example, |
| 1002 | |||
| 1003 | If items should be loaded but aren't, you may need to update the | ||
| 1004 | search throttle. @xref{Search Throttle}. If you see some tables that | ||
| 1005 | have 0 tags in them, then you you may have an incorrectly set | ||
| 1006 | throttle. 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 | ||
| 1013 | Here, @semantic{} found @file{foo.hh}, but there are 0 tags. This may | 971 | Here, @semantic{} found @file{foo.hh}, but there are 0 tags. This may |
| 1014 | be because the throttle was set to not read in and parse files that | 972 | be because you had set the throttle to avoid reading and parsing files |
| 1015 | Emacs has not yet loaded in. To fix this case, visit the file, and | 973 | that Emacs has not visited. To fix this, visit the file and let |
| 1016 | let @semantic{} parse and save the tags table. | 974 | @semantic{} parse it. |
| 975 | |||
| 976 | For C++, check also that the @samp{#include} statements for your | ||
| 977 | project-level files use quotes, not angle brackets; angle brackets are | ||
| 978 | for 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. | |||
| 1080 | The @code{dependants} slot will specify other files that depend on | 1042 | The @code{dependants} slot will specify other files that depend on |
| 1081 | this one. | 1043 | this one. |
| 1082 | 1044 | ||
| 1083 | @section Step 5: Check the parser | 1045 | @subsubsection Step 5: Check the parser |
| 1084 | 1046 | ||
| 1085 | Go to the location where your unfound tag should be. You can call | 1047 | Go 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. | |||
| 1104 | Or perhaps the parser needs to be fixed. | 1066 | Or 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 | |||
| 1073 | You can integrate @semantic{} with the Speedbar. | ||
| 1074 | @xref{Speedbar,,,emacs,Emacs manual}. To do this, add the following | ||
| 1075 | line to your init file: | ||
| 1076 | |||
| 1077 | @example | ||
| 1078 | (add-hook 'speedbar-load-hook (lambda () (require 'semantic/sb))) | ||
| 1079 | @end example | ||
| 1080 | |||
| 1081 | @noindent | ||
| 1082 | Or, alternatively: | ||
| 1083 | |||
| 1084 | @example | ||
| 1085 | (require 'semantic/sb) | ||
| 1086 | @end example | ||
| 1087 | |||
| 1088 | Once installed, the Speedbar will use @semantic{} to find and display | ||
| 1089 | tags. Tags from @semantic{} are displayed with more details than | ||
| 1090 | ordinary Speedbar tags, such as function arguments and return type. | ||
| 1091 | |||
| 1092 | In addition, you can use the Speedbar to show the output of the | ||
| 1093 | Semantic 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 | ||
| 1098 | Start the Speedbar in Semantic Analysis mode. | ||
| 1099 | @end deffn | ||
| 1100 | |||
| 1101 | In Semantic Analysis mode, the Speedbar displays information about the | ||
| 1102 | local context, such as the current function, local arguments and | ||
| 1103 | variables, and details on the prefix (the current symbol). Each entry | ||
| 1104 | has an @samp{<i>} button; clicking on this shows a summary of what | ||
| 1105 | @semantic{} knows about that variable or type. The Speedbar also | ||
| 1106 | displays 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}, | ||
| 1113 | such as GNU Global and GNU Idutils. These tools provide information | ||
| 1114 | about where different tags or symbols appear. | ||
| 1115 | |||
| 1116 | By default, @semantic{} tries to look for the best external symbol | ||
| 1117 | reference tool that can be used. The supported tools are GNU Global, | ||
| 1118 | GNU Idutils, CScope, and Grep (the fallback method). For best | ||
| 1119 | results, use GNU Global. However, @semantic{} does not manage your | ||
| 1120 | GNU Global tables for you; you must manage them yourself. | ||
| 1121 | |||
| 1122 | @defvar semantic-symref-tool | ||
| 1123 | The value of this variable is a symbol that determines the external | ||
| 1124 | symbol reference tool to use. The default value, @code{detect}, says | ||
| 1125 | to look for the best available tool. Other possible values are | ||
| 1126 | @code{global}, @code{idutils}, @code{cscope}, and @code{grep}. Note | ||
| 1127 | that @code{grep} is much slower than the others. | ||
| 1128 | @end defvar | ||
| 1129 | |||
| 1130 | The 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 | ||
| 1133 | Semantic mode is enabled (@pxref{Semantic mode user commands}). | ||
| 1134 | |||
| 1135 | @deffn Command semantic-symref-symbol sym | ||
| 1136 | This command (normally bound to @kbd{C-c , g}) prompts for a symbol | ||
| 1137 | name, and uses an external reference tool to find references to that | ||
| 1138 | tag. | ||
| 1139 | @end deffn | ||
| 1140 | |||
| 1141 | @deffn Command semantic-symref | ||
| 1142 | This command (normally bound to @kbd{C-c , G}) uses an external | ||
| 1143 | reference tool to find references to the current tag. | ||
| 1144 | @end deffn | ||
| 1145 | |||
| 1146 | Both @code{semantic-symref-symbol} and @code{semantic-symref} display | ||
| 1147 | a list of symbol references in a separate buffer. The entries are | ||
| 1148 | organized by file, and by function name. Typing @key{RET} on the | ||
| 1149 | @samp{[+]} next to each function name ``expands'' that entry, listing | ||
| 1150 | all references to the target symbol occurring within that function. | ||
| 1151 | Typing @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 | |||
| 1157 | Semantic MRU Bookmarks mode is a minor mode that keeps track of the | ||
| 1158 | tags 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 | ||
| 1162 | Toggle Semantic MRU Bookmarks mode globally. The minor mode can be | ||
| 1163 | turned on only if the current buffer was set up for parsing. With | ||
| 1164 | argument @var{arg}, turn the minor mode if @var{arg} is positive, and | ||
| 1165 | off otherwise. | ||
| 1166 | @end deffn | ||
| 1167 | |||
| 1168 | Semantic MRU Bookmarks mode takes note of each tag you edit. | ||
| 1169 | Afterwards, you can type @kbd{C-x B} | ||
| 1170 | (@code{semantic-mrub-switch-tags}) to return to a tag. This command | ||
| 1171 | prompts for a tag name, completing with the names of edited tags; at | ||
| 1172 | the prompt, you can use @kbd{M-p} and @kbd{M-n} to cycle through tags | ||
| 1173 | in order of last modification time. | ||
| 1174 | |||
| 1175 | @node Sticky Func Mode | ||
| 1176 | @section Sticky Function mode | ||
| 1177 | |||
| 1178 | Semantic Sticky Function minor mode displays a header line that shows | ||
| 1179 | the declaration line of the function or tag on the topmost line in the | ||
| 1180 | text area. This allows you to keep that declaration line in view at | ||
| 1181 | all times, even if it is scrolls off the ``top'' of the screen. | ||
| 1182 | |||
| 1183 | In addition, clicking @kbd{Mouse-1} on the header line opens a context | ||
| 1184 | menu that contains menu items for copying, killing, or narrowing to | ||
| 1185 | that tag. | ||
| 1186 | |||
| 1187 | @deffn Command global-semantic-stickyfunc-mode &optional arg | ||
| 1188 | Toggle Semantic Sticky Function mode in all Semantic-enabled buffers. | ||
| 1189 | With an optional argument @var{arg}, enable if @var{arg} is positive, | ||
| 1190 | and disable otherwise. | ||
| 1191 | @end deffn | ||
| 1192 | |||
| 1193 | @defvar semantic-stickyfunc-sticky-classes | ||
| 1194 | The value of this variable is a list of tag classes that Semantic | ||
| 1195 | Sticky Function mode makes ``sticky''. The default is | ||
| 1196 | @code{'(function type)}, meaning function declarations and type | ||
| 1197 | declarations. 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 | |||
| 1205 | Semantic Highlight Function minor mode highlights the declaration line | ||
| 1206 | of the current function or tag (that is to say, the first line that | ||
| 1207 | describes the rest of the construct). | ||
| 1208 | |||
| 1209 | In addition, clicking @kbd{Mouse-3} on the highlighted declaration | ||
| 1210 | line opens a context menu that contains menu items for copying, | ||
| 1211 | killing, or narrowing to that tag. | ||
| 1212 | |||
| 1213 | The tag classes highlighted by Semantic Highlight Function mode are | ||
| 1214 | the same ones given by @code{semantic-stickyfunc-sticky-classes}. | ||
| 1215 | @xref{Sticky Func Mode}. | ||
| 1216 | |||
| 1217 | @defun global-semantic-highlight-func-mode &optional arg | ||
| 1218 | Toggle Semantic Highlight Function mode in all Semantic-enabled | ||
| 1219 | buffers. With an optional argument @var{arg}, enable if @var{arg} is | ||
| 1220 | positive, and disable otherwise. | ||
| 1221 | @end defun | ||
| 1222 | |||
| 1223 | @deffn Face semantic-highlight-func-current-tag-face | ||
| 1224 | This face is used to highlight declaration lines in Semantic Highlight | ||
| 1225 | Func mode. | ||
| 1226 | @end deffn | ||
| 1227 | |||
| 1228 | @node Tag Decoration Mode | ||
| 1229 | @section Tag Decoration Mode | ||
| 1230 | @cindex semantic-decoration-mode | ||
| 1231 | |||
| 1232 | Semantic Tag Decoration mode ``decorates'' each tag based on certain | ||
| 1233 | arbitrary features of that tag. Decorations are specified using the | ||
| 1234 | variable @code{semantic-decoration-styles}. | ||
| 1235 | |||
| 1236 | @deffn Command global-semantic-decoration-mode &optional arg | ||
| 1237 | Toggle Semantic Tag Decoration mode in all Semantic-enabled buffers. | ||
| 1238 | With an optional argument @var{arg}, enable if @var{arg} is positive, | ||
| 1239 | and disable otherwise. | ||
| 1240 | @end deffn | ||
| 1241 | |||
| 1242 | @defvar semantic-decoration-styles | ||
| 1243 | The value of this variable is a list of decoration styles for Semantic | ||
| 1244 | Tag 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 | ||
| 1246 | symbol) and @var{flag} is non-@code{nil} if the style is enabled. | ||
| 1247 | |||
| 1248 | The following styles are available: | ||
| 1249 | |||
| 1250 | @table @code | ||
| 1251 | @item semantic-tag-boundary | ||
| 1252 | Place an overline in front of each long tag (excluding prototypes). | ||
| 1253 | |||
| 1254 | @item semantic-decoration-on-private-members | ||
| 1255 | Highlight class members that are designated as private. | ||
| 1256 | |||
| 1257 | @item semantic-decoration-on-protected-members | ||
| 1258 | Highlight class members that are designated as protected. | ||
| 1259 | |||
| 1260 | @item semantic-decoration-on-includes | ||
| 1261 | Highlight class members that are includes. Clicking on the | ||
| 1262 | highlighted include statements opens a context menu for configuring | ||
| 1263 | @semantic{} includes. | ||
| 1264 | @end table | ||
| 1265 | @end defvar | ||
| 1266 | |||
| 1267 | To enable or disable specific decorations, use this function: | ||
| 1268 | |||
| 1269 | @deffn Command semantic-toggle-decoration-style name &optional arg | ||
| 1270 | Prompt for a decoration style, @var{name}, and turn it on or off. | ||
| 1271 | With prefix argument @var{arg}, turn on if positive, otherwise off. | ||
| 1272 | Return non-@code{nil} if the decoration style is enabled. | ||
| 1273 | @end deffn | ||
| 1274 | |||
| 1275 | @deffn Face semantic-tag-boundary-face | ||
| 1276 | Face for long tags in the @code{semantic-tag-boundary} decoration | ||
| 1277 | style. | ||
| 1278 | @end deffn | ||
| 1279 | |||
| 1280 | @deffn Face semantic-decoration-on-private-members-face | ||
| 1281 | Face 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 | ||
| 1286 | Face 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 | ||
| 1291 | Face 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 | ||
| 1296 | Face 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 | ||
| 1301 | Face 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 | |||
| 1307 | You can create new types of decorations using the following function: | ||
| 1308 | |||
| 1309 | @defun define-semantic-decoration-style name doc &rest flags | ||
| 1310 | Define a new decoration style with @var{name}. | ||
| 1311 | @var{doc} is a documentation string describing the decoration style @var{name}. | ||
| 1312 | It is appended to auto-generated doc strings. | ||
| 1313 | An 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 | |||
| 1317 | This defines two new overload functions respectively called @code{NAME-p} | ||
| 1318 | and @code{NAME-highlight}, for which you must provide a default | ||
| 1319 | implementation in respectively the functions @code{NAME-p-default} and | ||
| 1320 | @code{NAME-highlight-default}. Those functions are passed a tag. @code{NAME-p} | ||
| 1321 | must return non-@code{nil} to indicate that the tag should be decorated by | ||
| 1322 | @code{NAME-highlight}. | ||
| 1323 | |||
| 1324 | To put primary decorations on a tag @code{NAME-highlight}, use | ||
| 1325 | functions like @dfn{semantic-set-tag-face}, | ||
| 1326 | @dfn{semantic-set-tag-intangible}, etc., found in the | ||
| 1327 | semantic-decorate library. | ||
| 1328 | |||
| 1329 | To add other kind of decorations on a tag, @code{NAME-highlight} must use | ||
| 1330 | @dfn{semantic-decorate-tag}, and other functions of the semantic | ||
| 1331 | decoration @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 | ||
| 233 | This chapter provides an overview of the internals of @semantic{}. | 224 | This chapter provides an overview of the internals of @semantic{}. |
| 234 | This information would not be needed by neither application developers | 225 | This information is usually not needed by application developers or |
| 235 | nor grammar developers. | 226 | grammar developers; it is useful mostly for the hackers who would like |
| 236 | 227 | to learn more about how @semantic{} works. | |
| 237 | It would be useful mostly for the hackers who would like to learn | ||
| 238 | more 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 |