I don't know why github's org parser is playing games with me
[geiser.git] / README
blob2a62aefa3286efa3b8f887d835b4732271a42f74
1 -*- mode: org -*-
2 * Overview
4   Geiser is a generic Emacs/Scheme interaction mode, featuring an
5   enhanced REPL and a set of minor modes improving Emacs' basic scheme
6   major mode. The main functionalities provided are:
8     - Evaluation of forms in the namespace of the current module.
9     - Macro expansion.
10     - File/module loading.
11     - Namespace-aware identifier completion (including local bindings,
12       names visible in the current module, and module names).
13     - Autodoc: the echo area shows information about the signature of
14       the procedure/macro around point automatically.
15     - Jump to definition of identifier at point.
16     - Access to documentation (including docstrings when the
17       implementation provides it).
18     - Listings of identifiers exported by a given module.
19     - Listings of callers/callees of procedures.
20     - Rudimentary support for debugging (list of
21       evaluation/compilation error in an Emacs' compilation-mode
22       buffer).
23     - Support for inline images in schemes, such as Racket, that treat
24       them as first order values.
26    NOTE: if you're not in a hurry, Geiser's website
27    (http://www.nongnu.org/geiser/) contains a nicer manual, also
28    included in Geiser tarballs as a texinfo file (doc/geiser.info).
30 * Requirements
32     Geiser needs Emacs 23.2 or better, and at least one of the
33     supported scheme implementations:
34       - Guile 2.2 or better.
35       - PLT Racket 6.0 or better.
36       - Chicken 4.8.0 or better.
37       - MIT/GNU Scheme 9.1.1 or better.
38       - Chibi 0.7.3 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 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:
56 #+BEGIN_EXAMPLE
57      $ chicken-install -s apropos chicken-doc
58 #+END_EXAMPLE
60     - Update the Chicken documentation database:
62 #+BEGIN_EXAMPLE
63      $ cd `csi -p '(chicken-home)'`
64      $ curl http://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx
65 #+END_EXAMPLE
67 * Basic configuration
69   The loading invocations above install all supported Scheme
70   implementations. You can list explicitly the ones that you want by
71   setting the variable =geiser-active-implementations= *before* loading
72   geiser.el. For instance:
74 #+BEGIN_SRC elisp
75     (setq geiser-active-implementations '(chicken guile))
76 #+END_SRC
78   On opening a scheme file, Geiser will try to guess its Scheme,
79   defaulting to the first in the list. Use =C-c C-s= to select the
80   implementation by hand (on a per file basis).
82   Check the geiser customization group for some options with:
84 #+BEGIN_EXAMPLE
85       M-x customize-group RET geiser RET
86 #+END_EXAMPLE
88   In particular, customize =geiser-<impl>-binary=, which should point
89   to an executable in your path.
91   To start a REPL, =M-x geiser=.
93 ** Completion with company-mode
95     Geiser offers identifier and module name completion, bound to
96     =M-TAB= and =M-`= respectively. Only names visible in the current
97     module are offered.
99     While that is cool and all, things are even better: if you have
100     [[http://company-mode.github.io/][company mode]] installed, Geiser's completion will use it. Just
101     require company-mode and, from then on, any new scheme buffer or
102     REPL will use it.
104 * Quick key reference
106 ** In Scheme buffers:
108    |-------------+--------------------------------------------------|
109    | C-c C-s     | Specify Scheme implementation for buffer         |
110    | C-c C-z     | Switch to REPL                                   |
111    | C-c C-a     | Switch to REPL and current module                |
112    |-------------+--------------------------------------------------|
113    | M-.         | Go to definition of identifier at point          |
114    | M-,         | Go back to where M-. was last invoked            |
115    | C-c C-e m   | Ask for a module and open its file               |
116    | C-c C-e C-l | Add a given directory to Scheme's load path      |
117    | C-c C-e [   | Toggle between () and [] for current form        |
118    |-------------+--------------------------------------------------|
119    | C-M-x       | Eval definition around point                     |
120    | C-c C-c     | Eval definition around point                     |
121    | C-c M-e     | Eval definition around point and switch to REPL  |
122    | C-x C-e     | Eval sexp before point                           |
123    | C-c C-r     | Eval region                                      |
124    | C-c M-r     | Eval region and switch to REPL                   |
125    | C-c C-b     | Eval buffer                                      |
126    | C-c M-b     | Eval buffer and switch to REPL                   |
127    |-------------+--------------------------------------------------|
128    | C-c C-m x   | Macro-expand definition around point             |
129    | C-c C-m e   | Macro-expand sexp before point                   |
130    | C-c C-m r   | Macro-expand region                              |
131    |-------------+--------------------------------------------------|
132    | C-c C-k     | Compile and load current buffer                  |
133    | C-c C-l     | Load scheme file                                 |
134    | C-u C-c C-k | Compile and load current buffer, restarting REPL |
135    |-------------+--------------------------------------------------|
136    | C-c C-d d   | See documentation for identifier at point        |
137    | C-c C-d s   | See short documentation for identifier at point  |
138    | C-c C-d i   | Look up manual for identifier at point           |
139    | C-c C-d m   | See a list of a module's exported identifiers    |
140    | C-c C-d a   | Toggle autodoc mode                              |
141    |-------------+--------------------------------------------------|
142    | C-c <       | Show callers of procedure at point               |
143    | C-c >       | Show callees of procedure at point               |
144    |-------------+--------------------------------------------------|
145    | M-TAB       | Complete identifier at point                     |
146    | M-`, C-.    | Complete module name at point                    |
147    | TAB         | Complete identifier at point or indent           |
148    |             | (If geiser-mode-smart-tab-p is t)                |
149    |-------------+--------------------------------------------------|
151 ** In the REPL
153     |-------------+----------------------------------------------------|
154     | C-c C-z     | Start Scheme REPL, or jump to previous buffer      |
155     | C-c M-o     | Clear scheme output                                |
156     | C-c C-q     | Kill Scheme process                                |
157     | C-c C-l     | Load scheme file                                   |
158     | C-c C-k     | Nuke REPL: use it if the REPL becomes unresponsive |
159     |-------------+----------------------------------------------------|
160     | M-.         | Edit identifier at point                           |
161     | TAB, M-TAB  | Complete identifier at point                       |
162     | M-`, C-.    | Complete module name at point                      |
163     | M-p, M-n    | Prompt history, matching current prefix            |
164     |-------------+----------------------------------------------------|
165     | C-c C-m     | Set current module                                 |
166     | C-c C-i     | Import module into current namespace               |
167     | C-c C-r     | Add a given directory to scheme's load path        |
168     |-------------+----------------------------------------------------|
169     | C-c C-d C-d | See documentation for symbol at point              |
170     | C-c C-d C-m | See documentation for module                       |
171     | C-c C-d C-a | Toggle autodoc mode                                |
172     |-------------+----------------------------------------------------|
174 ** In the documentation browser:
176     |----------+----------------------------------------------|
177     | f        | Next page                                    |
178     | b        | Previous page                                |
179     |----------+----------------------------------------------|
180     | TAB, n   | Next link                                    |
181     | S-TAB, p | Previous link                                |
182     | N        | Next section                                 |
183     | P        | Previous section                             |
184     |----------+----------------------------------------------|
185     | k        | Kill current page and go to previous or next |
186     | g, r     | Refresh page                                 |
187     | c        | Clear browsing history                       |
188     |----------+----------------------------------------------|
189     | ., M-.   | Edit identifier at point                     |
190     | z        | Switch to REPL                               |
191     |----------+----------------------------------------------|
192     | q        | Bury buffer                                  |
193     |----------+----------------------------------------------|
195 ** In backtrace (evaluation/compile result) buffers:
197     - =M-g n=, =M-g p=, =C-x `= for error navigation.
198     - =q= to bury buffer.