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