Back to index

texmacs  1.0.7.15
Defines | Functions
complete.cpp File Reference
#include <iostream>

Go to the source code of this file.

Defines

#define DATA_BEGIN   ((char) 2)
#define DATA_END   ((char) 5)
#define DATA_COMMAND   ((char) 16)
#define DATA_ESCAPE   ((char) 27)

Functions

void format_plugin ()
int main ()

Define Documentation

#define DATA_BEGIN   ((char) 2)

Definition at line 15 of file complete.cpp.

#define DATA_COMMAND   ((char) 16)

Definition at line 17 of file complete.cpp.

#define DATA_END   ((char) 5)

Definition at line 16 of file complete.cpp.

#define DATA_ESCAPE   ((char) 27)

Definition at line 18 of file complete.cpp.


Function Documentation

void format_plugin ( )

Definition at line 21 of file complete.cpp.

                 {
  // The configuration of a plugin can be completed at startup time.
  // This is for instance interesting if you add tab-completion a posteriori.
  cout << DATA_BEGIN << "command:";
  cout << "(plugin-configure complete (:tab-completion #t))";
  cout << DATA_END;
}

Here is the caller graph for this function:

int main ( )

Definition at line 30 of file complete.cpp.

        {
  cout << DATA_BEGIN << "verbatim:";
  format_plugin ();
  cout << "We know how to complete 'h'";
  cout << DATA_END;
  cout.flush ();

  while (true) {
    char buffer[100];
    cin.getline (buffer, 100, '\n');
    if (buffer[0] != DATA_COMMAND) {
      cout << DATA_BEGIN << "verbatim:";
      cout << "You typed " << buffer;
      cout << DATA_END;
    }
    else {
      cout << DATA_BEGIN << "scheme:";
      cout << "(tuple \"h\" \"ello\" \"i there\" \"ola\" \"opsakee\")";
      cout << DATA_END;
    }
    cout.flush ();
  }
  return 0;
}

Here is the call graph for this function: