README tweaks
[geiser.git] / README.org
blob304ceac44d0ad7be11755f21be3a9120484b58eb
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).
23    NOTE: if you're not in a hurry, [[http://www.nongnu.org/geiser/][Geiser's website]] contains a nicer
24    manual, also included in Geiser tarballs as a texinfo file
25    (doc/geiser.info).
27 * Supported scheme implementations
29     - Guile 2.0 (not released yet: use the latest git master branch).
30     - PLT Racket 5.0.1 or better.
32 * Installation
33   Geiser can be used either directly from its uninstalled source tree
34   or byte-compiled and installed after perfoming the standard
35   configure/make/make install dance.
37 *** In place
38     - Extract the tarball or clone the git repository anywhere in your
39       file system. Let's call that place <path-to-geiser>.
40     - In your .emacs:
42       #+BEGIN_SRC emacs-lisp
43       (load-file "<path-to-geiser>/elisp/geiser.el")
44       #+END_SRC
46 *** Byte-compiled
47     - Create a build directory, `build', say:
48       #+BEGIN_SRC shell
49       $ cd <path-to-geiser>
50       $ mkdir build; cd build
51       #+END_SRC
52     - Configure and make:
53       #+BEGIN_SRC shell
54       $ ../configure && make
55       #+END_SRC
57     Now, you can use the byte-compiled Geiser in place by adding to
58     your .emacs:
60     #+BEGIN_SRC emacs-lisp
61     (load "<path-to-geiser>/build/elisp/geiser-load")
62     #+END_SRC
64     or, alternatively, install it with:
66     #+BEGIN_SRC shell
67     $ make install
68     #+END_SRC
70     (you might need to get root access, depending on your installation
71     directory) and, instead of the above load forms, require
72     'geiser-install (not 'geiser, mind you) in your emacs
73     initialization file:
75     #+BEGIN_SRC emacs-lisp
76     (require 'geiser-install)
77     #+END_SRC
79     You're ready to go!
81 * Basic configuration
82   The loading invocations above install all supported Scheme
83   implementations. You can list explicitly the ones that you want by
84   setting the variable `geiser-impl-installed-implementations' *before*
85   loading geiser.el. For instance:
87     #+BEGIN_SRC emacs-lisp
88     (setq geiser-impl-installed-implementations '(racket guile))
89     #+END_SRC
91    On opening a scheme file, Geiser will try to guess its Scheme,
92    defaulting to the first in the list. Use `C-c C-s' to select the
93    implementation by hand (on a per file basis).
95   Check the geiser customization group for some options with:
97       M-x customize-group RET geiser RET
99   In particular, customize `geiser-<impl>-binary', which should point
100   to an executable in your path.
102   To start a REPL, M-x geiser.
104 *** Completion with company-mode
105     Geiser offers identifier and module name completion, bound to
106     M-TAB and M-` respectively. Only names visible in the current
107     module are offered.
109     While that is cool and all, things are even better: if you have
110     [[http://nschum.de/src/emacs/company-mode/][company-mode]] installed, Geiser's completion will use it. Just
111     require company-mode and, from then on, any new scheme buffer or
112     REPL will use it. If you didn't know about Nikolaj Schumacher's
113     awesome mode, check [[http://www.screentoaster.com/watch/stU0lSRERIR1pYRFVdXVlRVFFV/company_mode_for_gnu_emacs][this screencast]].
115 * Quick key reference
117 *** In Scheme buffers:
119     |---------------------+-------------------------------------------------|
120     | C-c C-z             | Switch to REPL                                  |
121     |---------------------+-------------------------------------------------|
122     | C-u C-c C-z         | Switch to REPL and current module               |
123     |---------------------+-------------------------------------------------|
124     | C-c C-s             | Specify Scheme implementation for buffer        |
125     |---------------------+-------------------------------------------------|
126     | M-.                 | Go to definition of identifier at point         |
127     |---------------------+-------------------------------------------------|
128     | M-,                 | Go back to where M-. was last invoked           |
129     |---------------------+-------------------------------------------------|
130     | C-c C-e m           | Ask for a module and open its file              |
131     |---------------------+-------------------------------------------------|
132     | C-M-x               | Eval definition around point                    |
133     |---------------------+-------------------------------------------------|
134     | C-c M-e             | Eval definition around point and switch to REPL |
135     |---------------------+-------------------------------------------------|
136     | C-x C-e             | Eval sexp before point                          |
137     |---------------------+-------------------------------------------------|
138     | C-c C-r             | Eval region                                     |
139     |---------------------+-------------------------------------------------|
140     | C-c M-r             | Eval region and switch to REPL                  |
141     |---------------------+-------------------------------------------------|
142     | C-c C-m x           | Macro-expand definition around point            |
143     |---------------------+-------------------------------------------------|
144     | C-c C-m e           | Macro-expand sexp before point                  |
145     |---------------------+-------------------------------------------------|
146     | C-c C-m r           | Marcro-expand region                            |
147     |---------------------+-------------------------------------------------|
148     | C-u C-c C-m [x,e,r] | (With prefix, macro expansions are recursive)   |
149     |---------------------+-------------------------------------------------|
150     | C-c C-k             | Compile and load current file                   |
151     |---------------------+-------------------------------------------------|
152     | C-c C-l             | Load current file                               |
153     |---------------------+-------------------------------------------------|
154     | C-c C-d d           | See documentation for identifier at point       |
155     |---------------------+-------------------------------------------------|
156     | C-c C-d m           | See a list of a module's exported identifiers   |
157     |---------------------+-------------------------------------------------|
158     | C-c C-d a           | Toggle autodoc mode                             |
159     |---------------------+-------------------------------------------------|
160     | C-c<                | Show callers of procedure at point              |
161     |---------------------+-------------------------------------------------|
162     | C-c>                | Show callees of procedure at point              |
163     |---------------------+-------------------------------------------------|
164     | C-c C-x f           | See a generic's methods signatures              |
165     |---------------------+-------------------------------------------------|
166     | M-TAB               | Complete identifier at point                    |
167     |---------------------+-------------------------------------------------|
168     | M-`, C-.            | Complete module name at point                   |
169     |---------------------+-------------------------------------------------|
170     | TAB                 | Complete identifier at point or indent          |
171     |                     | (If `geiser-mode-smart-tab-p' is t)             |
172     |---------------------+-------------------------------------------------|
174 *** In the REPL
176     |-------------+----------------------------------------------------|
177     | C-c C-z     | Start Scheme REPL, or jump to previous buffer      |
178     |-------------+----------------------------------------------------|
179     | C-c C-q     | Kill Scheme process                                |
180     |-------------+----------------------------------------------------|
181     | M-.         | Edit identifier at point                           |
182     |-------------+----------------------------------------------------|
183     | TAB, M-TAB  | Complete identifier at point                       |
184     |-------------+----------------------------------------------------|
185     | M-`, C-.    | Complete module name at point                      |
186     |-------------+----------------------------------------------------|
187     | M-p, M-n    | Prompt history, matching current prefix            |
188     |-------------+----------------------------------------------------|
189     | C-c C-k     | Nuke REPL: use it if the REPL becomes unresponsive |
190     |-------------+----------------------------------------------------|
191     | C-c C-m     | Set current module                                 |
192     |-------------+----------------------------------------------------|
193     | C-c C-i     | Import module into current namespace               |
194     |-------------+----------------------------------------------------|
195     | C-c C-l     | Load scheme file                                   |
196     |-------------+----------------------------------------------------|
197     | C-c C-d C-d | See documentation for symbol at point              |
198     |-------------+----------------------------------------------------|
199     | C-c C-d C-m | See documentation for module                       |
200     |-------------+----------------------------------------------------|
201     | C-c C-d C-a | Toggle autodoc mode                                |
202     |-------------+----------------------------------------------------|
204 *** In the documentation browser:
206     |------------+----------------------------------------------|
207     | n, f       | Next page                                    |
208     |------------+----------------------------------------------|
209     | p, b       | Previous page                                |
210     |------------+----------------------------------------------|
211     | TAB, S-TAB | Next/previous link                           |
212     |------------+----------------------------------------------|
213     | k          | Kill current page and go to previous or next |
214     |------------+----------------------------------------------|
215     | g, r       | Refresh page                                 |
216     |------------+----------------------------------------------|
217     | c          | Clear browsing history                       |
218     |------------+----------------------------------------------|
219     | ., M-.     | Edit identifier at point                     |
220     |------------+----------------------------------------------|
221     | z          | Switch to REPL                               |
222     |------------+----------------------------------------------|
223     | q          | Bury buffer                                  |
224     |------------+----------------------------------------------|
226 *** In backtrace (evaluation/compile result) buffers:
228     - TAB, M-TAB for error navigation.
229     - q to bury buffer.