File: interface-channels.en.tm

package info (click to toggle)
texmacs 1%3A2.1.4%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 145,076 kB
  • sloc: cpp: 227,393; lisp: 197,386; ansic: 5,395; python: 1,939; makefile: 1,065; sh: 781; perl: 339; xml: 100; awk: 36
file content (111 lines) | stat: -rw-r--r-- 2,953 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<TeXmacs|1.0.7.14>

<style|tmdoc>

<\body>
  <tmdoc-title|Output channels, prompts and default input>

  Besides blocks of the form

  <\quotation>
    <framed-fragment|<verbatim|<render-key|DATA_BEGIN><em|format>:<em|message><render-key|DATA_END>>>
  </quotation>

  the <TeXmacs> meta-format also allows you to use blocks of the form

  <\quotation>
    <framed-fragment|<verbatim|<render-key|DATA_BEGIN><em|channel>#<em|message><render-key|DATA_END>>>
  </quotation>

  Here <verbatim|<em|channel>> specifies an ``output channel'' to which the
  body <verbatim|<em|message>> has to be sent. The default output channel is
  <verbatim|output>, but we also provide channels <verbatim|prompt> and
  <verbatim|input> for specifying the prompt and a default input for the next
  input in a session. Default inputs may be useful for instance be useful for
  demo modes of computer algebra systems. In the future, we also plan to
  support <verbatim|error> and <verbatim|status> channels.

  <paragraph*|The <verbatim|prompt> plug-in>

  The <verbatim|prompt> plug-in shows how to use prompts. It consists of the
  files

  <\verbatim>
    \ \ \ \ <example-plugin-link|prompt/Makefile>

    \ \ \ \ <example-plugin-link|prompt/progs/init-prompt.scm>

    \ \ \ \ <example-plugin-link|prompt/src/prompt.cpp>
  </verbatim>

  The routine for displaying the next prompt is given by

  <\cpp-code>
    void

    next_input () {

    \ \ counter++;

    \ \ cout \<less\>\<less\> DATA_BEGIN \<less\>\<less\> "prompt#";

    \ \ cout \<less\>\<less\> "Input " \<less\>\<less\> counter
    \<less\>\<less\> "] ";

    \ \ cout \<less\>\<less\> DATA_END;

    }
  </cpp-code>

  This routine is both used for displaying the startup banner

  <\cpp-code>
    cout \<less\>\<less\> DATA_BEGIN \<less\>\<less\> "verbatim:";

    cout \<less\>\<less\> "A LaTeX -\<gtr\> TeXmacs converter";

    next_input ();

    cout \<less\>\<less\> DATA_END;

    cout.flush ();
  </cpp-code>

  and in the body of the main loop

  <\cpp-code>
    char buffer[100];

    cin.getline (buffer, 100, '\\n');

    cout \<less\>\<less\> DATA_BEGIN \<less\>\<less\> "verbatim:";

    cout \<less\>\<less\> DATA_BEGIN;

    cout \<less\>\<less\> "latex:$" \<less\>\<less\> buffer \<less\>\<less\>
    "$";

    cout \<less\>\<less\> DATA_END;

    next_input ();

    cout \<less\>\<less\> DATA_END;

    cout.flush ();
  </cpp-code>

  <tmdoc-copyright|1998--2002|Joris van der Hoeven>

  <tmdoc-license|Permission is granted to copy, distribute and/or modify this
  document under the terms of the GNU Free Documentation License, Version 1.1
  or any later version published by the Free Software Foundation; with no
  Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  Texts. A copy of the license is included in the section entitled "GNU Free
  Documentation License".>
</body>

<\initial>
  <\collection>
    <associate|language|english>
  </collection>
</initial>