diff options
| author | Chong Yidong | 2009-11-20 05:02:46 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-11-20 05:02:46 +0000 |
| commit | 673286f5f950551d05b5d9ece9e96ee05e446155 (patch) | |
| tree | 243c4f1ffc9dbff1e4f6b40e0057ba17c74132c6 /doc | |
| parent | 02e1b4886fd7e2b673841a697782383e3b7ceb22 (diff) | |
| download | emacs-673286f5f950551d05b5d9ece9e96ee05e446155.tar.gz emacs-673286f5f950551d05b5d9ece9e96ee05e446155.zip | |
* sem-user.texi (Idle Completions Mode): More copyedits.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/misc/sem-user.texi | 230 |
2 files changed, 129 insertions, 105 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index cffce1a6996..3c0cfc16a73 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | 2009-11-20 Chong Yidong <cyd@stupidchicken.com> | 1 | 2009-11-20 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * sem-user.texi (Semanticdb Search Configuration): Rearrange nodes. | 3 | * sem-user.texi (Semanticdb Search Configuration): Rearrange nodes. |
| 4 | (Search Throttle, Semanticdb Roots, Include paths, Idle Scheduler): | 4 | (Search Throttle, Semanticdb Roots, Include paths, Idle Scheduler) |
| 5 | Numerous copyedits. | 5 | (Idle Completions Mode): Numerous copyedits. |
| 6 | 6 | ||
| 7 | 2009-11-17 Juanma Barranquero <lekktu@gmail.com> | 7 | 2009-11-17 Juanma Barranquero <lekktu@gmail.com> |
| 8 | 8 | ||
diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi index 38bb1d6982e..dfca1a09295 100644 --- a/doc/misc/sem-user.texi +++ b/doc/misc/sem-user.texi | |||
| @@ -582,50 +582,47 @@ This hook is not protected from lexical errors. | |||
| 582 | @node Idle Working Options | 582 | @node Idle Working Options |
| 583 | @subsection Idle Working Options | 583 | @subsection Idle Working Options |
| 584 | 584 | ||
| 585 | Similiar to the reparsing that occurs at short intervals in idle | 585 | In addition to reparsing buffers, the Semantic idle scheduler performs |
| 586 | time, there is extra work that can be controlled to occur in idle time | 586 | additional operations, including the following: |
| 587 | also. | ||
| 588 | |||
| 589 | Idle work occurs after a longer delay, and can be very time | ||
| 590 | consuming. The work done includes: | ||
| 591 | |||
| 592 | @table @asis | ||
| 593 | @item Create Include Path Caches | ||
| 594 | Create the optimized search caches needed for symbol lookup. | ||
| 595 | @item Create Type Cache | ||
| 596 | Create the datatype caches needed for intellisense features. | ||
| 597 | @item Save Databases | ||
| 598 | All file-based @semantic{} databases are saved to disk. | ||
| 599 | @item Parse neighboring files | ||
| 600 | All files in the same directory as the current buffer are | ||
| 601 | speculatively parsed. | ||
| 602 | @end table | ||
| 603 | 587 | ||
| 604 | These features can be controlled with the following variables: | 588 | @itemize |
| 589 | @item | ||
| 590 | Creating the include path caches required for symbol lookup. | ||
| 591 | @item | ||
| 592 | Create data type caches. | ||
| 593 | @item | ||
| 594 | Saving SemanticDB caches to disk. | ||
| 595 | @item | ||
| 596 | Speculatively parsing the files in the same directory as the current | ||
| 597 | buffer. | ||
| 598 | @end itemize | ||
| 599 | |||
| 600 | Because this extra work is quite time-consuming, it is only carried | ||
| 601 | out after a longer idle delay. The following features control how the | ||
| 602 | idle work is performed. | ||
| 605 | 603 | ||
| 606 | @deffn Option semantic-idle-scheduler-work-idle-time | ||
| 607 | @anchor{semantic-idle-scheduler-work-idle-time} | 604 | @anchor{semantic-idle-scheduler-work-idle-time} |
| 608 | Time in seconds of idle before scheduling big work. | 605 | @deffn Option semantic-idle-scheduler-work-idle-time |
| 609 | This time should be long enough that once any big work is started, it is | 606 | The value of this variable is the amount of idle time, in seconds, |
| 610 | unlikely the user would be ready to type again right away. | 607 | before commencing idle work. The default is 60. |
| 611 | @end deffn | 608 | @end deffn |
| 612 | 609 | ||
| 613 | @deffn Option semantic-idle-work-parse-neighboring-files-flag | ||
| 614 | @anchor{semantic-idle-work-parse-neighboring-files-flag} | 610 | @anchor{semantic-idle-work-parse-neighboring-files-flag} |
| 615 | Non-@code{nil} means to parse files in the same dir as the current buffer. | 611 | @deffn Option semantic-idle-work-parse-neighboring-files-flag |
| 616 | Disable to prevent lots of excessive parsing in idle time. | 612 | If the value of this variable is non-@code{nil}, the Semantic idle |
| 613 | scheduler uses idle work time to parse files in the same directory as | ||
| 614 | the current buffer. This improves the accuracy of tag searches and | ||
| 615 | saves time when visiting those files later, at the cost of doing a lot | ||
| 616 | of parsing. The default is @code{t}. | ||
| 617 | @end deffn | 617 | @end deffn |
| 618 | 618 | ||
| 619 | @node Debugging Idle Time Issues | 619 | @node Debugging Idle Time Issues |
| 620 | @subsection Debugging Idle Time Issues | 620 | @subsection Debugging Idle Time Issues |
| 621 | 621 | ||
| 622 | If you see errors produced in idle time, it could be an indication of a | 622 | If you see an error signalled during idle time, it could be an |
| 623 | more serious issue elsewhere. It is not enough to enable | 623 | indication of a more serious issue elsewhere. It is not enough to |
| 624 | @code{debug-on-error}, as the idle timer tries to keep errors under | 624 | enable @code{debug-on-error}, because the idle scheduler inhibits the |
| 625 | wraps. | 625 | debugger. Instead, use the following commands to debug the error: |
| 626 | |||
| 627 | Instead, there are two commands you can use whenever you see an idle | ||
| 628 | error. | ||
| 629 | 626 | ||
| 630 | @deffn Command semantic-debug-idle-function | 627 | @deffn Command semantic-debug-idle-function |
| 631 | @anchor{semantic-debug-idle-function} | 628 | @anchor{semantic-debug-idle-function} |
| @@ -637,103 +634,130 @@ Run the Semantic idle function with debugging turned on. | |||
| 637 | Run the Semantic idle work function with debugging turned on. | 634 | Run the Semantic idle work function with debugging turned on. |
| 638 | @end deffn | 635 | @end deffn |
| 639 | 636 | ||
| 640 | Once you identify the general location of the idle error, you can send | ||
| 641 | the stack trace to the mailing list, or perhaps find a more focused | ||
| 642 | way to reproduce the issue. | ||
| 643 | |||
| 644 | @node Idle Summary Mode | 637 | @node Idle Summary Mode |
| 645 | @subsection Idle Summary Mode | 638 | @subsection Idle Summary Mode |
| 646 | 639 | ||
| 647 | Similar to the Emacs Lisp facility eldoc, | 640 | Semantic Idle Summary mode is a minor mode that displays a short |
| 648 | @code{semantic-idle-summary-mode} will display the prototype, or other | 641 | summary of the symbol at point, such as its function prototype, in the |
| 649 | helpful doc about the symbol currently under point. | 642 | echo area. Its functionality is similar to what ElDoc mode provides |
| 650 | 643 | for Emacs Lisp (@pxref{Lisp Doc,,,emacs,Emacs manual}). | |
| 651 | 644 | ||
| 652 | @deffn semantic-idle-summary-mode &optional arg | 645 | @anchor{global-semantic-idle-summary-mode} |
| 653 | @anchor{semantic-idle-summary-mode} | 646 | @anchor{semantic-idle-summary-mode} |
| 654 | Display a tag summary of the lexical token under the cursor. | 647 | @deffn global-semantic-idle-summary-mode &optional arg |
| 655 | This means for getting the current tag to display information can | 648 | This command toggles Semantic Idle Summary mode in all |
| 656 | be overriden with @code{idle-summary-current-symbol-info}. | 649 | @semantic{}-enabled buffers. You can also toggle it via the |
| 657 | This is a minor mode which performs actions during idle time. | 650 | @samp{Show Tag Summaries} menu item in the @samp{Development} menu. |
| 658 | With prefix argument ARG, turn on if positive, otherwise off. The | ||
| 659 | minor mode can be turned on only if semantic feature is available and | ||
| 660 | the current buffer was set up for parsing. Return non-nil if the | ||
| 661 | minor mode is enabled | ||
| 662 | @end deffn | 651 | @end deffn |
| 663 | 652 | ||
| 664 | @obsolete{semantic-summary-mode, semantic-idle-summary-mode} | 653 | When Semantic Idle Summary mode is active, a summary of the tag at |
| 654 | point is displayed in the echo area. This display takes place during | ||
| 655 | the idle time, as given by @code{semantic-idle-scheduler-idle-time} | ||
| 656 | (@pxref{Idle Scheduler}). | ||
| 657 | |||
| 658 | You can override the method for getting the current tag to display by | ||
| 659 | setting @code{idle-summary-current-symbol-info}. | ||
| 665 | 660 | ||
| 666 | @deffn Option semantic-idle-summary-function | ||
| 667 | @anchor{semantic-idle-summary-function} | 661 | @anchor{semantic-idle-summary-function} |
| 668 | Function to use when displaying tag information during idle time. | 662 | @deffn Option semantic-idle-summary-function |
| 669 | Some useful functions are found in @code{semantic-format-tag-functions}. | 663 | The value of this variable should be a function to call to display tag |
| 664 | information during idle time. See the variable | ||
| 665 | @code{semantic-format-tag-functions} for a list of useful functions. | ||
| 670 | @end deffn | 666 | @end deffn |
| 671 | 667 | ||
| 672 | @defvar semantic-idle-summary-out-of-context-faces | ||
| 673 | @anchor{semantic-idle-summary-out-of-context-faces} | 668 | @anchor{semantic-idle-summary-out-of-context-faces} |
| 674 | List of font-lock faces that indicate a useless summary context. | 669 | @defvar semantic-idle-summary-out-of-context-faces |
| 675 | Those are generally faces used to highlight comments or strings. | 670 | The value of this variable is a list of font-lock faces indicating |
| 676 | 671 | useless summary contexts. These are generally faces used to highlight | |
| 677 | It might be useful to override this variable to add comment faces | 672 | comments or strings. Semantic Idle Summary mode does not display its |
| 678 | specific to a major mode. For example, in jde mode: | 673 | usual summary if the text at point has one of these faces. |
| 679 | |||
| 680 | @example | ||
| 681 | (defvar-mode-local jde-mode semantic-idle-summary-out-of-context-faces | ||
| 682 | (append (default-value 'semantic-idle-summary-out-of-context-faces) | ||
| 683 | '(jde-java-font-lock-doc-tag-face | ||
| 684 | jde-java-font-lock-link-face | ||
| 685 | jde-java-font-lock-bold-face | ||
| 686 | jde-java-font-lock-underline-face | ||
| 687 | jde-java-font-lock-pre-face | ||
| 688 | jde-java-font-lock-code-face))) | ||
| 689 | @end example | ||
| 690 | |||
| 691 | @end defvar | 674 | @end defvar |
| 692 | 675 | ||
| 693 | @node Idle Completions Mode | 676 | @node Idle Completions Mode |
| 694 | @subsection Idle Completions Mode | 677 | @subsection Idle Completions Mode |
| 695 | 678 | ||
| 696 | The definition of smart completion is described in the Analyzer | 679 | Semantic Idle Completions mode is a minor mode for performing |
| 697 | section @ref{Analyzer}. | 680 | @dfn{code completions} during idle time. The completions are |
| 681 | displayed inline, with keybindings that allow you to cycle through | ||
| 682 | different alternatives. | ||
| 698 | 683 | ||
| 699 | The Idle Completions mode will calculate the list of possible | 684 | @c @xref{Analyzer}, for information about code |
| 700 | completions in idle time, and display them in a popup list, or other | 685 | @c completion. |
| 701 | inline completion mechanism. | ||
| 702 | 686 | ||
| 703 | @deffn semantic-idle-completions-mode &optional arg | 687 | @anchor{global-semantic-idle-completions-mode} |
| 704 | @anchor{semantic-idle-completions-mode} | 688 | @anchor{semantic-idle-completions-mode} |
| 705 | Display a tooltip with a list of possible completions near the cursor. | 689 | @deffn global-semantic-idle-completions-mode &optional arg |
| 706 | There is no convenience for performing a completion replacement. For | 690 | This command toggles Semantic Idle Completions mode in every |
| 707 | that you should bind @code{semantic-ia-complete-symbol}. | 691 | @semantic{}-enabled buffer. You can also toggle it via the @samp{Show |
| 708 | This is a minor mode which performs actions during idle time. | 692 | Tag Completions} menu item in the @samp{Development} menu. |
| 709 | With prefix argument ARG, turn on if positive, otherwise off. The | ||
| 710 | minor mode can be turned on only if semantic feature is available and | ||
| 711 | the current buffer was set up for parsing. Return non-nil if the | ||
| 712 | minor mode is enabled | ||
| 713 | @end deffn | 693 | @end deffn |
| 714 | 694 | ||
| 715 | This mode operates by using the command | 695 | If the tag at point has at least one completion, Semantic Idle |
| 716 | @code{semantic-complete-inline-analyzer}. | 696 | Completions mode displays that completion inline---i.e., as part of |
| 697 | the buffer text (you can change the display method by customizing | ||
| 698 | @code{semantic-complete-inline-analyzer-idle-displayor-class}, as | ||
| 699 | described below). The completed part is highlighted, to indicate that | ||
| 700 | it is not yet properly inserted into the buffer. The echo area shows | ||
| 701 | the completion, and whether there are other possible completions, like | ||
| 702 | this: | ||
| 717 | 703 | ||
| 718 | Idle completion uses the completion function | 704 | @example |
| 719 | @code{semantic-complete-analyze-inline-idle}. Changing the behavior of | 705 | besselj [1 of 6 matches] |
| 720 | the idle completion popups should be done through those utilities. | 706 | @end example |
| 707 | |||
| 708 | @noindent | ||
| 709 | While the completion is being displayed, the following keybindings | ||
| 710 | take effect: | ||
| 711 | |||
| 712 | @table @kbd | ||
| 713 | @item @key{RET} | ||
| 714 | @itemx C-m | ||
| 715 | Accept the current completion (@code{semantic-complete-inline-done}), | ||
| 716 | placing it in the buffer and moving point to the end of the completed | ||
| 717 | tag. | ||
| 718 | @item M-n | ||
| 719 | Select the next possible completion | ||
| 720 | (@code{semantic-complete-inline-down}). The new completion is shown | ||
| 721 | inline, replacing the old completion. | ||
| 722 | @item M-p | ||
| 723 | Select the previous possible completion | ||
| 724 | (@code{semantic-complete-inline-up}). | ||
| 725 | @item @key{TAB} | ||
| 726 | @item C-i | ||
| 727 | Accept as much of the completion as possible. If no additional | ||
| 728 | completion can be accepted without ambiguity, select the next possible | ||
| 729 | completion (@code{semantic-complete-inline-TAB}). | ||
| 730 | @item C-g | ||
| 731 | Quit without completing (@code{semantic-complete-inline-quit}). | ||
| 732 | @end table | ||
| 733 | |||
| 734 | @noindent | ||
| 735 | You can also exit inline completion by issuing any other Emacs | ||
| 736 | command. The completion text then disappears from the buffer. | ||
| 721 | 737 | ||
| 722 | @deffn Command semantic-complete-analyze-inline-idle | ||
| 723 | @anchor{semantic-complete-analyze-inline-idle} | 738 | @anchor{semantic-complete-analyze-inline-idle} |
| 724 | Perform prompt completion to do in buffer completion. | 739 | @deffn Command semantic-complete-analyze-inline-idle |
| 725 | @dfn{semantic-analyze-possible-completions} is used to determine the | 740 | This is the command for performing inline code completion. It is |
| 726 | possible values. | 741 | called by Semantic Idle Completions mode during idle time, but you can |
| 727 | The function returns immediately, leaving the buffer in a mode that | 742 | also call it yourself. It returns immediately, leaving the buffer in |
| 728 | will perform the completion. | 743 | a state for inline completion. |
| 729 | Configure @code{semantic-complete-inline-analyzer-idle-displayor-class} | ||
| 730 | to change how completion options are displayed. | ||
| 731 | @end deffn | 744 | @end deffn |
| 732 | 745 | ||
| 733 | @deffn Option semantic-complete-inline-analyzer-idle-displayor-class | ||
| 734 | @anchor{semantic-complete-inline-analyzer-idle-displayor-class} | 746 | @anchor{semantic-complete-inline-analyzer-idle-displayor-class} |
| 735 | Class for displayor to use with inline completion at idle time. | 747 | @deffn Option semantic-complete-inline-analyzer-idle-displayor-class |
| 748 | The value of this variable determines how | ||
| 749 | @code{semantic-complete-analyze-inline-idle} shows its completions. | ||
| 750 | Possible values include: | ||
| 736 | 751 | ||
| 737 | Customize this variable to get a list of options, such as popup | 752 | @table @code |
| 738 | tooltips, ghosting text, or traditional completion tools. | 753 | @item semantic-displayor-ghost |
| 754 | Display completions ``inline'' with the buffer text, as described | ||
| 755 | above. This is the default value. | ||
| 756 | |||
| 757 | @item semantic-displayor-tooltip | ||
| 758 | Display completions in a tooltip. | ||
| 759 | |||
| 760 | @item semantic-displayor-traditional | ||
| 761 | Display completions in a separate window. | ||
| 762 | @end table | ||
| 739 | @end deffn | 763 | @end deffn |