~ubuntu-branches/ubuntu/hardy/texmacs/hardy

« back to all changes in this revision

Viewing changes to TeXmacs/examples/plugins/substitute/src/substitute.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2004-04-19 20:34:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040419203400-g4e34ih0315wcn8v
Tags: upstream-1.0.3-R2
ImportĀ upstreamĀ versionĀ 1.0.3-R2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/******************************************************************************
 
3
* MODULE     : substitute.cpp
 
4
* DESCRIPTION: Use plugins in an invisible way: substitute selections
 
5
*              by their evaluations (see ../progs/init-substitute.scm)
 
6
* COPYRIGHT  : (C) 2003  Joris van der Hoeven
 
7
*******************************************************************************
 
8
* This software falls under the GNU general public license and comes WITHOUT
 
9
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
 
10
* If you don't have this file, write to the Free Software Foundation, Inc.,
 
11
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
12
******************************************************************************/
 
13
 
 
14
#include <stdio.h>
 
15
#include <iostream.h>
 
16
 
 
17
#define DATA_BEGIN   ((char) 2)
 
18
#define DATA_END     ((char) 5)
 
19
#define DATA_ESCAPE  ((char) 27)
 
20
 
 
21
int
 
22
main () {
 
23
  cout << DATA_BEGIN << "verbatim:";
 
24
  cout << "An interactive LaTeX -> TeXmacs translator\n";
 
25
  cout << "Can also be used outside sessions: select a LaTeX expression\n";
 
26
  cout << "and press C-F12\n";
 
27
  cout << DATA_END;
 
28
  fflush (stdout);
 
29
 
 
30
  while (true) {
 
31
    char buffer[100];
 
32
    cin.getline (buffer, 100, '\n');
 
33
    cout << DATA_BEGIN;
 
34
    cout << "latex:$" << buffer << "$";
 
35
    cout << DATA_END;
 
36
    fflush (stdout);
 
37
  }
 
38
  return 0;
 
39
}