missing NULL terminator in set_config_x
[geda-gaf.git] / docs / wiki / geda-gschem_repl.html
blobb4510a98beff4ae66ae4a94970b0e0a82b69ea4b
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
5 <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />
6 <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />
7 <link rel="stylesheet" media="print" type="text/css" href="./print.css" />
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 </head>
11 <body>
13 <p>
14 <em>Translations of this page are also available in the following languages:</em> <a href="geda-gschem_repl.ru.html" class="wikilink1" title="geda-gschem_repl.ru.html">Русский</a>.
15 </p>
17 <h1 class="sectionedit1" id="using_repl_in_gschem">Using REPL in gschem</h1>
18 <div class="level1">
20 </div>
21 <!-- EDIT1 SECTION "Using REPL in gschem" [114-148] -->
22 <h2 class="sectionedit2" id="embedded_graphical_repl_functions_in_gschem">Embedded graphical REPL functions in gschem</h2>
23 <div class="level2">
25 <p>
26 The entry field for guile procedures is opened with hitting the
27 key sequence <kbd>G</kbd><kbd>:</kbd> (g, colon). After doing this the user may enter
28 commands in the appeared field and watch the results of their work
29 in the gschem log window.
30 </p>
32 </div>
33 <!-- EDIT2 SECTION "Embedded graphical REPL functions in gschem" [149-448] -->
34 <h2 class="sectionedit3" id="repl_in_the_background_terminal">REPL in the background terminal</h2>
35 <div class="level2">
37 <p>
38 There is an additional menu entry for working with
39 REPL in the background terminal, which is invoked with hitting
40 key sequence <kbd>G</kbd><kbd>R</kbd>.
41 </p>
43 <p>
44 Please note, that for the moment you can run it several times,
45 which may confuse your terminal. Moreover, there is a risk of
46 closing working instance of gschem by using some shortkeys.
47 </p>
49 <p>
50 For more convenient work in the terminal you may want to turn on
51 the functions of the <em>readline</em> library. For that, type in the
52 terminal:
53 </p>
54 <pre class="code">(use-modules (ice-9 readline))
55 (activate-readline)</pre>
57 </div>
58 <!-- EDIT3 SECTION "REPL in the background terminal" [449-1039] -->
59 <h2 class="sectionedit4" id="external_graphical_repl">External graphical REPL</h2>
60 <div class="level2">
62 <p>
63 For invoking external graphical REPL window you have to have a
64 REPL functions library from the <em>guile-gnome</em>. In Debian, for
65 instance, you have to install the package <em>guile-gnome2-gtk</em>
66 to may use it. To open the window, type in the field of the
67 embedded REPL in gschem as follows:
68 </p>
69 <pre class="code">(use-modules (gnome-2) (gnome gtk) (gnome gtk graphical-repl))
70 (guile-gtk-repl)</pre>
72 </div>
73 <!-- EDIT4 SECTION "External graphical REPL" [1040-1457] -->
74 <h2 class="sectionedit5" id="repl_in_any_terminal">REPL in any terminal</h2>
75 <div class="level2">
77 <p>
78 In order to invoke REPL in a terminal you have to open a REPL
79 socket in gschem. To do so, load the system REPL module and call
80 the function of server spawning:
81 </p>
82 <pre class="code">(use-modules (system repl server))
83 (spawn-server)</pre>
85 <p>
86 When called without arguments, the spawn-server function uses the
87 default guile port 37146. You can define another port:
88 </p>
89 <pre class="code">(spawn-server 1234)</pre>
91 <p>
92 When you&#039;re opening a port, please note the security risks described
93 <a href="https://lists.gnu.org/archive/html/guile-devel/2010-10/msg00044.html" class="urlextern" title="https://lists.gnu.org/archive/html/guile-devel/2010-10/msg00044.html" rel="nofollow">here</a>.
94 </p>
96 <p>
97 Then you just need to connect to the port using any program which
98 is able to do this, for example,
99 <strong>telnet</strong>,
100 <strong>netcat</strong>, or some other. Example of using <strong>telnet</strong>:
101 </p>
102 <pre class="code">$ telnet localhost 37146</pre>
105 Example of using <strong>netcat</strong>:
106 </p>
107 <pre class="code">$ nc localhost 37146</pre>
110 In this case the <em>readline</em> interface won&#039;t work.
111 </p>
114 <strong>Emacs</strong> users may use a shiny <em>Geiser</em> environment for working
115 with REPL in that program.
116 For that to work, you have to install this package, run the REPL
117 server in gschem and connect to it in <strong>Emacs</strong> using <kbd>M</kbd>+<kbd>X</kbd>
118 <strong><code>connect-to-guile</code></strong>.
119 </p>
121 </div>
122 <!-- EDIT5 SECTION "REPL in any terminal" [1458-] --></body>
123 </html>