2 /******************************************************************************
3 * MODULE : complete.cpp
4 * DESCRIPTION: Shows how to program tab-completion
5 * COPYRIGHT : (C) 2003 Joris van der Hoeven
6 *******************************************************************************
7 * This software falls under the GNU general public license version 3 or later.
8 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ******************************************************************************/
15 #define DATA_BEGIN ((char) 2)
16 #define DATA_END ((char) 5)
17 #define DATA_COMMAND ((char) 16)
18 #define DATA_ESCAPE ((char) 27)
22 // The configuration of a plugin can be completed at startup time.
23 // This is for instance interesting if you add tab-completion a posteriori.
24 cout
<< DATA_BEGIN
<< "command:";
25 cout
<< "(plugin-configure complete (:tab-completion #t))";
31 cout
<< DATA_BEGIN
<< "verbatim:";
33 cout
<< "We know how to complete 'h'";
39 cin
.getline (buffer
, 100, '\n');
40 if (buffer
[0] != DATA_COMMAND
) {
41 cout
<< DATA_BEGIN
<< "verbatim:";
42 cout
<< "You typed " << buffer
;
46 cout
<< DATA_BEGIN
<< "scheme:";
47 cout
<< "(tuple \"h\" \"ello\" \"i there\" \"ola\" \"opsakee\")";