Add Gambit source files to makefiles
[geiser.git] / README.org
blob8ee4fb6b91faf5d811af409e502f4b3bdad2fbe3
1 * Overview
3   Geiser is a generic Emacs/Scheme interaction mode, featuring an
4   enhanced REPL and a set of minor modes improving Emacs' basic scheme
5   major mode. The main functionalities provided are:
7     - Evaluation of forms in the namespace of the current module.
8     - Macro expansion.
9     - File/module loading.
10     - Namespace-aware identifier completion (including local bindings,
11       names visible in the current module, and module names).
12     - Autodoc: the echo area shows information about the signature of
13       the procedure/macro around point automatically.
14     - Jump to definition of identifier at point.
15     - Access to documentation (including docstrings when the
16       implementation provides it).
17     - Listings of identifiers exported by a given module.
18     - Listings of callers/callees of procedures.
19     - Rudimentary support for debugging (list of
20       evaluation/compilation error in an Emacs' compilation-mode
21       buffer).
22     - Support for inline images in schemes, such as Racket, that treat
23       them as first order values.
25    NOTE: if you're not in a hurry, [[http://www.nongnu.org/geiser/][Geiser's website]] contains a much
26    nicer manual.
28 * Requirements
30     Geiser needs Emacs 24 or better, and at least one of the supported
31     scheme implementations:
33       - Guile 2.2 or better.
34       - Chicken 4.8.0 or better.
35       - MIT/GNU Scheme 9.1.1 or better.
36       - Chibi 0.7.3 or better.
37       - Gambit 4.9.3 or better.
38       - Racket 6.0 or better.
39       - Chez 9.4 or better.
41 * Installation
43   The easiest way is to use MELPA, and just type
44   =M-x package-install RET geiser= inside emacs.
46   Geiser can be used either directly from its uninstalled source tree
47   or byte-compiled and installed after performing the standard
48   configure/make/make install dance.  See the INSTALL file for more details.
50 ** Chicken 5 Addendum
51     These steps are necessary to fully support Chicken Scheme, but are
52     not required for any other scheme.
54     - Install the necessary support eggs:
55       #+BEGIN_EXAMPLE
56       $ chicken-install -s apropos chicken-doc srfi-18 srfi-1
57       #+END_EXAMPLE
58     - Update the Chicken documentation database:
59       #+BEGIN_EXAMPLE
60       $ cd `csi -R chicken.platform -p '(chicken-home)'`
61       $ curl https://3e8.org/pub/chicken-doc/chicken-doc-repo-5.tgz | sudo tar zx
62       #+END_EXAMPLE
64 ** Chicken 4 Addendum
65     These steps are necessary to fully support Chicken Scheme, but are
66     not required for any other scheme.
68     - Install the necessary support eggs:
70 #+BEGIN_EXAMPLE
71      $ chicken-install -s apropos chicken-doc
72 #+END_EXAMPLE
74     - Update the Chicken documentation database:
76 #+BEGIN_EXAMPLE
77      $ cd `csi -p '(chicken-home)'`
78      $ curl http://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx
79 #+END_EXAMPLE
81 ** Gambit Addendum
82     These steps are necessary to fully support Gambit Scheme.
84     1 - clone the last version of gambit
85     2 - configure gambit using --enable-rtlib-debug-source to activate autodoc
86 #+BEGIN_EXAMPLE
87     $ cd ~/
88     $ git clone "the gambit repo address"
89     $ cd gambit
90     $ ./configure --enable-single-host --enable-debug --enable-rtlib-debug-source
91     $ make bootstrap
92     $ make bootclean
93     $ make -j
94     $ make install
95 #+END_EXAMPLE
97 * Basic configuration
99   The loading invocations above install all supported Scheme
100   implementations. You can list explicitly the ones that you want by
101   setting the variable =geiser-active-implementations= *before* loading
102   geiser.el. For instance:
104 #+BEGIN_SRC elisp
105     (setq geiser-active-implementations '(chicken guile))
106 #+END_SRC
108   On opening a scheme file, Geiser will try to guess its Scheme,
109   defaulting to the first in the list. Use =C-c C-s= to select the
110   implementation by hand (on a per file basis).
112   Check the geiser customization group for some options with:
114 #+BEGIN_EXAMPLE
115       M-x customize-group RET geiser RET
116 #+END_EXAMPLE
118   In particular, customize =geiser-<impl>-binary=, which should point
119   to an executable in your path.
121   To start a REPL, =M-x geiser=.
123 ** Completion with company-mode
125     Geiser offers identifier and module name completion, bound to
126     =M-TAB= and =M-`= respectively. Only names visible in the current
127     module are offered.
129     While that is cool and all, things are even better: if you have
130     [[http://company-mode.github.io/][company mode]] installed, Geiser's completion will use it. Just
131     require company-mode and, from then on, any new scheme buffer or
132     REPL will use it.
134 * Quick key reference
136   (See also [[file:///home/jao/usr/jao/geiser/web/geiser_5.html#Cheat-sheet][the manual]]'s cheat sheet)
138 ** In Scheme buffers:
140    |-------------+--------------------------------------------------|
141    | C-c C-s     | Specify Scheme implementation for buffer         |
142    | C-c C-z     | Switch to REPL                                   |
143    | C-c C-a     | Switch to REPL and current module                |
144    |             |                                                  |
145    |-------------+--------------------------------------------------|
146    | M-.         | Go to definition of identifier at point          |
147    | M-,         | Go back to where M-. was last invoked            |
148    | C-c C-e m   | Ask for a module and open its file               |
149    | C-c C-e C-l | Add a given directory to Scheme's load path      |
150    | C-c C-e [   | Toggle between () and [] for current form        |
151    | c-c C-e \   | Insert λ                                         |
152    |             |                                                  |
153    |-------------+--------------------------------------------------|
154    | C-M-x       | Eval definition around point                     |
155    | C-c C-c     | Eval definition around point                     |
156    | C-c M-e     | Eval definition around point and switch to REPL  |
157    | C-x C-e     | Eval sexp before point                           |
158    | C-c C-r     | Eval region                                      |
159    | C-c M-r     | Eval region and switch to REPL                   |
160    | C-c C-b     | Eval buffer                                      |
161    | C-c M-b     | Eval buffer and switch to REPL                   |
162    |             |                                                  |
163    |-------------+--------------------------------------------------|
164    | C-c C-m x   | Macro-expand definition around point             |
165    | C-c C-m e   | Macro-expand sexp before point                   |
166    | C-c C-m r   | Macro-expand region                              |
167    |             |                                                  |
168    |-------------+--------------------------------------------------|
169    | C-c C-k     | Compile and load current buffer                  |
170    | C-c C-l     | Load scheme file                                 |
171    | C-u C-c C-k | Compile and load current buffer, restarting REPL |
172    |             |                                                  |
173    |-------------+--------------------------------------------------|
174    | C-c C-d d   | See documentation for identifier at point        |
175    | C-c C-d s   | See short documentation for identifier at point  |
176    | C-c C-d i   | Look up manual for identifier at point           |
177    | C-c C-d m   | See a list of a module's exported identifiers    |
178    | C-c C-d a   | Toggle autodoc mode                              |
179    |             |                                                  |
180    |-------------+--------------------------------------------------|
181    | C-c <       | Show callers of procedure at point               |
182    | C-c >       | Show callees of procedure at point               |
183    |             |                                                  |
184    |-------------+--------------------------------------------------|
185    | M-TAB       | Complete identifier at point                     |
186    | M-`, C-.    | Complete module name at point                    |
187    | TAB         | Complete identifier at point or indent           |
188    |             | (If geiser-mode-smart-tab-p is t)                |
189    |-------------+--------------------------------------------------|
191 ** In the REPL
193     |-------------+----------------------------------------------------|
194     | C-c C-z     | Start Scheme REPL, or jump to previous buffer      |
195     | C-c M-o     | Clear scheme output                                |
196     | C-c C-q     | Kill Scheme process                                |
197     | C-c C-l     | Load scheme file                                   |
198     | C-c C-k     | Nuke REPL: use it if the REPL becomes unresponsive |
199     |             |                                                    |
200     |-------------+----------------------------------------------------|
201     | M-.         | Edit identifier at point                           |
202     | TAB, M-TAB  | Complete identifier at point                       |
203     | M-`, C-.    | Complete module name at point                      |
204     | M-p, M-n    | Prompt history, matching current prefix            |
205     |             |                                                    |
206     |-------------+----------------------------------------------------|
207     | C-c \       | Insert λ                                           |
208     | C-c [       | Toggle between () and [] for current form          |
209     |             |                                                    |
210     |-------------+----------------------------------------------------|
211     | C-c C-m     | Set current module                                 |
212     | C-c C-i     | Import module into current namespace               |
213     | C-c C-r     | Add a given directory to scheme's load path        |
214     |             |                                                    |
215     |-------------+----------------------------------------------------|
216     | C-c C-d C-d | See documentation for symbol at point              |
217     | C-c C-d C-m | See documentation for module                       |
218     | C-c C-d C-a | Toggle autodoc mode                                |
219     |-------------+----------------------------------------------------|
221 ** In the documentation browser:
223     |----------+----------------------------------------------|
224     | f        | Next page                                    |
225     | b        | Previous page                                |
226     |          |                                              |
227     |----------+----------------------------------------------|
228     | TAB, n   | Next link                                    |
229     | S-TAB, p | Previous link                                |
230     | N        | Next section                                 |
231     | P        | Previous section                             |
232     |          |                                              |
233     |----------+----------------------------------------------|
234     | k        | Kill current page and go to previous or next |
235     | g, r     | Refresh page                                 |
236     | c        | Clear browsing history                       |
237     |          |                                              |
238     |----------+----------------------------------------------|
239     | ., M-.   | Edit identifier at point                     |
240     | z        | Switch to REPL                               |
241     |          |                                              |
242     |----------+----------------------------------------------|
243     | q        | Bury buffer                                  |
244     |----------+----------------------------------------------|
246 ** In backtrace (evaluation/compile result) buffers:
248     - =M-g n=, =M-g p=, =C-x `= for error navigation.
249     - =q= to bury buffer.