install.texi
[geiser.git] / README.org
blobea7834111b7ba3624f7fc72249a8821120bcd02f
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.
36     The following schemes are supported via an independent package,
37     installable from MELPA:
39       - MIT/GNU Scheme via  [[https://gitlab.com/emacs-geiser/mit][geiser-mit]]
40       - Kawa via [[https://gitlab.com/emacs-geiser/kawa][geiser-kawa]]
41       - Stklos via [[https://gitlab.com/emacs-geiser/stklos][geiser-stklos]]
42       - Chibi 0.7.3 or better.
43       - Gambit 4.9.3 or better.
44       - Racket 6.0 or better.
45       - Chez 9.4 or better.
47 * Installation
49   The easiest way is to use MELPA, and just type =M-x package-install
50   RET geiser= inside emacs.  The, if needed, install also the package
51   corresponding to your preferred scheme (~geiser-kawa~, ~geiser-mit~,
52   etc.).
54   Geiser can be used either directly from its uninstalled source tree
55   or byte-compiled and installed after performing the standard
56   configure/make/make install dance.  See the INSTALL file for more details.
58 ** Chicken 5 Addendum
59     These steps are necessary to fully support Chicken Scheme, but are
60     not required for any other scheme.
62     - Install the necessary support eggs:
63       #+BEGIN_EXAMPLE
64       $ chicken-install -s apropos chicken-doc srfi-18 srfi-1
65       #+END_EXAMPLE
66     - Update the Chicken documentation database:
67       #+BEGIN_EXAMPLE
68       $ cd `csi -R chicken.platform -p '(chicken-home)'`
69       $ curl https://3e8.org/pub/chicken-doc/chicken-doc-repo-5.tgz | sudo tar zx
70       #+END_EXAMPLE
72 ** Chicken 4 Addendum
73     These steps are necessary to fully support Chicken Scheme, but are
74     not required for any other scheme.
76     - Install the necessary support eggs:
78 #+BEGIN_EXAMPLE
79      $ chicken-install -s apropos chicken-doc
80 #+END_EXAMPLE
82     - Update the Chicken documentation database:
84 #+BEGIN_EXAMPLE
85      $ cd `csi -p '(chicken-home)'`
86      $ curl http://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx
87 #+END_EXAMPLE
89 * Basic configuration
91   The loading invocations above install all supported Scheme
92   implementations. You can list explicitly the ones that you want by
93   setting the variable =geiser-active-implementations= *before* loading
94   geiser.el. For instance:
96 #+BEGIN_SRC elisp
97     (setq geiser-active-implementations '(chicken guile))
98 #+END_SRC
100   On opening a scheme file, Geiser will try to guess its Scheme,
101   defaulting to the first in the list. Use =C-c C-s= to select the
102   implementation by hand (on a per file basis).
104   Check the geiser customization group for some options with:
106 #+BEGIN_EXAMPLE
107       M-x customize-group RET geiser RET
108 #+END_EXAMPLE
110   In particular, customize =geiser-<impl>-binary=, which should point
111   to an executable in your path.
113   To start a REPL, =M-x geiser=.
115 ** Completion with company-mode
117     Geiser offers identifier and module name completion, bound to
118     =M-TAB= and =M-`= respectively. Only names visible in the current
119     module are offered.
121     While that is cool and all, things are even better: if you have
122     [[http://company-mode.github.io/][company mode]] installed, Geiser's completion will use it. Just
123     require company-mode and, from then on, any new scheme buffer or
124     REPL will use it.
126 * Quick key reference
128   (See also [[file:///home/jao/usr/jao/geiser/web/geiser_5.html#Cheat-sheet][the manual]]'s cheat sheet)
130 ** In Scheme buffers:
132    |-------------+--------------------------------------------------|
133    | C-c C-s     | Specify Scheme implementation for buffer         |
134    | C-c C-z     | Switch to REPL                                   |
135    | C-c C-a     | Switch to REPL and current module                |
136    |             |                                                  |
137    |-------------+--------------------------------------------------|
138    | M-.         | Go to definition of identifier at point          |
139    | M-,         | Go back to where M-. was last invoked            |
140    | C-c C-e m   | Ask for a module and open its file               |
141    | C-c C-e C-l | Add a given directory to Scheme's load path      |
142    | C-c C-e [   | Toggle between () and [] for current form        |
143    | c-c C-e \   | Insert λ                                         |
144    |             |                                                  |
145    |-------------+--------------------------------------------------|
146    | C-M-x       | Eval definition around point                     |
147    | C-c C-c     | Eval definition around point                     |
148    | C-c M-e     | Eval definition around point and switch to REPL  |
149    | C-x C-e     | Eval sexp before point                           |
150    | C-c C-r     | Eval region                                      |
151    | C-c M-r     | Eval region and switch to REPL                   |
152    | C-c C-b     | Eval buffer                                      |
153    | C-c M-b     | Eval buffer and switch to REPL                   |
154    |             |                                                  |
155    |-------------+--------------------------------------------------|
156    | C-c C-m x   | Macro-expand definition around point             |
157    | C-c C-m e   | Macro-expand sexp before point                   |
158    | C-c C-m r   | Macro-expand region                              |
159    |             |                                                  |
160    |-------------+--------------------------------------------------|
161    | C-c C-k     | Compile and load current buffer                  |
162    | C-c C-l     | Load scheme file                                 |
163    | C-u C-c C-k | Compile and load current buffer, restarting REPL |
164    |             |                                                  |
165    |-------------+--------------------------------------------------|
166    | C-c C-d d   | See documentation for identifier at point        |
167    | C-c C-d s   | See short documentation for identifier at point  |
168    | C-c C-d i   | Look up manual for identifier at point           |
169    | C-c C-d m   | See a list of a module's exported identifiers    |
170    | C-c C-d a   | Toggle autodoc mode                              |
171    |             |                                                  |
172    |-------------+--------------------------------------------------|
173    | C-c <       | Show callers of procedure at point               |
174    | C-c >       | Show callees of procedure at point               |
175    |             |                                                  |
176    |-------------+--------------------------------------------------|
177    | M-TAB       | Complete identifier at point                     |
178    | M-`, C-.    | Complete module name at point                    |
179    | TAB         | Complete identifier at point or indent           |
180    |             | (If geiser-mode-smart-tab-p is t)                |
181    |-------------+--------------------------------------------------|
183 ** In the REPL
185     |-------------+----------------------------------------------------|
186     | C-c C-z     | Start Scheme REPL, or jump to previous buffer      |
187     | C-c M-o     | Clear scheme output                                |
188     | C-c C-q     | Kill Scheme process                                |
189     | C-c C-l     | Load scheme file                                   |
190     | C-c C-k     | Nuke REPL: use it if the REPL becomes unresponsive |
191     |             |                                                    |
192     |-------------+----------------------------------------------------|
193     | M-.         | Edit identifier at point                           |
194     | TAB, M-TAB  | Complete identifier at point                       |
195     | M-`, C-.    | Complete module name at point                      |
196     | M-p, M-n    | Prompt history, matching current prefix            |
197     |             |                                                    |
198     |-------------+----------------------------------------------------|
199     | C-c \       | Insert λ                                           |
200     | C-c [       | Toggle between () and [] for current form          |
201     |             |                                                    |
202     |-------------+----------------------------------------------------|
203     | C-c C-m     | Set current module                                 |
204     | C-c C-i     | Import module into current namespace               |
205     | C-c C-r     | Add a given directory to scheme's load path        |
206     |             |                                                    |
207     |-------------+----------------------------------------------------|
208     | C-c C-d C-d | See documentation for symbol at point              |
209     | C-c C-d C-m | See documentation for module                       |
210     | C-c C-d C-a | Toggle autodoc mode                                |
211     |-------------+----------------------------------------------------|
213 ** In the documentation browser:
215     |----------+----------------------------------------------|
216     | f        | Next page                                    |
217     | b        | Previous page                                |
218     |          |                                              |
219     |----------+----------------------------------------------|
220     | TAB, n   | Next link                                    |
221     | S-TAB, p | Previous link                                |
222     | N        | Next section                                 |
223     | P        | Previous section                             |
224     |          |                                              |
225     |----------+----------------------------------------------|
226     | k        | Kill current page and go to previous or next |
227     | g, r     | Refresh page                                 |
228     | c        | Clear browsing history                       |
229     |          |                                              |
230     |----------+----------------------------------------------|
231     | ., M-.   | Edit identifier at point                     |
232     | z        | Switch to REPL                               |
233     |          |                                              |
234     |----------+----------------------------------------------|
235     | q        | Bury buffer                                  |
236     |----------+----------------------------------------------|
238 ** In backtrace (evaluation/compile result) buffers:
240     - =M-g n=, =M-g p=, =C-x `= for error navigation.
241     - =q= to bury buffer.