1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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" />
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>.
17 <h1 class=
"sectionedit1" id=
"using_repl_in_gschem">Using REPL in gschem
</h1>
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>
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.
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>
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>.
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.
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
54 <pre class=
"code">(use-modules (ice-
9 readline))
55 (activate-readline)
</pre>
58 <!-- EDIT3 SECTION "REPL in the background terminal" [449-1039] -->
59 <h2 class=
"sectionedit4" id=
"external_graphical_repl">External graphical REPL
</h2>
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:
69 <pre class=
"code">(use-modules (gnome-
2) (gnome gtk) (gnome gtk graphical-repl))
70 (guile-gtk-repl)
</pre>
73 <!-- EDIT4 SECTION "External graphical REPL" [1040-1457] -->
74 <h2 class=
"sectionedit5" id=
"repl_in_any_terminal">REPL in any terminal
</h2>
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:
82 <pre class=
"code">(use-modules (system repl server))
86 When called without arguments, the spawn-server function uses the
87 default guile port
37146. You can define another port:
89 <pre class=
"code">(spawn-server
1234)
</pre>
92 When you
'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>.
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>:
102 <pre class=
"code">$ telnet localhost
37146</pre>
105 Example of using
<strong>netcat
</strong>:
107 <pre class=
"code">$ nc localhost
37146</pre>
110 In this case the
<em>readline
</em> interface won
't work.
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>.
122 <!-- EDIT5 SECTION "REPL in any terminal" [1458-] --></body>