<\body> By default, looks into your document for possible tab-completions. Inside sessions for your application, you might wish to customize this behaviour, so as to complete built-in commands. In order to do this, you have to specify the configuration option <\scm-code> (:tab-completion #t) in your .scm> file, so that will send special tab-completion requests to your application whenever you press inside a session. These commands are of the form <\quotation> <\framed-fragment> <\verbatim> (complete ) Here stands for the special character (ASCII 16). The > is the complete string in which the occurred and the > is an integer which specifies the position of the cursor when you pressed . expects your application to return a tuple with all possible tab-completions of the form <\quotation> <\framed-fragment> scheme:(tuple >>)> Here > corresponds to a substring before the cursor for which completions could be found. The strings > until > are the list of completions as they might be inserted at the current cursor position. If no completions could be found, then you may also return the empty string. <\remark> In principle, the tab-completion mechanism should still work in mathematical input mode. In that case, the > will correspond to the serialization of the input. <\remark> The way sends commands to your application can be customized in a similar way as for the input: we provide a configuration option for this, which works in a similar way as the option. plug-in> A very rudimentary example of how the tab-completion mechanism works is given by the plug-in, which consists of the following files: <\verbatim> \ \ \ \ \ \ \ \ \ \ \ \ The startup banner in takes care of part of the configuration: <\cpp-code> cout \\ DATA_BEGIN \\ "verbatim:"; format_plugin (); cout \\ "We know how to complete 'h'"; cout \\ DATA_END; fflush (stdout); Here is given by <\cpp-code> void format_plugin () { \ \ // The configuration of a plugin can be completed at startup time. \ \ // This may be interesting for adding tab-completion a posteriori. \ \ cout \\ DATA_BEGIN \\ "command:"; \ \ cout \\ "(plugin-configure complete (:tab-completion #t))"; \ \ cout \\ DATA_END; } In the main loop, we first deal with regular input: <\cpp-code> char buffer[100]; cin.getline (buffer, 100, '\\n'); if (buffer[0] != DATA_COMMAND) { \ \ cout \\ DATA_BEGIN \\ "verbatim:"; \ \ cout \\ "You typed " \\ buffer; \ \ cout \\ DATA_END; } We next treat the case when a tab-completion command is sent to the application: <\cpp-code> else { \ \ cout \\ DATA_BEGIN \\ "scheme:"; \ \ cout \\ "(tuple \\"h\\" \\"ello\\" \\"i there\\" \\"ola\\" \\"opsakee\\")"; \ \ cout \\ DATA_END; } cout.flush (); As you notice, the actual command is ignored, so our example is really very rudimentary. <\initial> <\collection>