Allow loading byte-compiled Geiser without make install
[geiser.git] / README
blob001bd63240067d6948a360623c0700a89d1b82fa
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 * Supported scheme implementations
25     - Guile 2.0 (not released yet: use the latest git master branch).
26     - PLT Racket 5.0.1 or better.
28 * Installation
29   Geiser can be used either directly from its uninstalled source tree
30   or byte-compiled and installed after perfoming the standard
31   configure/make/make install dance.
33 *** In place
34     - Extract the tarball or clone the git repository anywhere in your
35       file system. Let's call that place <path-to-geiser>.
36     - In your .emacs:
38       (load-file "<path-to-geiser>/elisp/geiser.el")
40 *** Byte-compiled
41     - Create a build directory, `build', say:
42       $ cd <path-to-geiser>
43       $ mkdir build; cd build
44     - Configure and make:
45       $ ../configure && make
47     Now, you can use the byte-compiled Geiser in place by adding to
48     your .emacs:
50     (load "<path-to-geiser>/build/elisp/geiser-load")
52     or, alternatively, install it with:
54       $ make install
56     (you might need to get root access, depending on your installation
57     directory) and, instead of the above load forms, require
58     'geiser-install (not 'geiser, mind you) in your emacs
59     initialization file:
61       (require 'geiser-install)
63     You're ready to go!
65 * Basic configuration
66   The loading invocations above install all supported Scheme
67   implementations. You can list explicitly the ones that you want by
68   setting the variable `geiser-impl-installed-implementations' *before*
69   loading geiser.el. For instance:
71       (setq geiser-impl-installed-implementations '(racket guile))
73    On opening a scheme file, Geiser will try to guess its Scheme,
74    defaulting to the first in the list. Use `C-c C-s' to select the
75    implementation by hand (on a per file basis).
77   Check the geiser customization group for some options with:
79       M-x customize-group RET geiser RET
81   In particular, customize `geiser-repl-<impl>-binary' (in
82   geiser-repl), which should point to an executable in your path.
84   To start a REPL, M-x geiser.
86 *** Completion with company-mode
87     Geiser offers identifier and module name completion, bound to
88     M-TAB and M-` respectively. Only names visible in the current
89     module are offered.
91     While that is cool and all, things are even better: if you have
92     [[http://nschum.de/src/emacs/company-mode/][company-mode]] installed, Geiser's completion will use it. Just
93     require company-mode and, from then on, any new scheme buffer or
94     REPL will use it. If you didn't know about Nikolaj Schumacher's
95     awesome mode, check [[http://www.screentoaster.com/watch/stU0lSRERIR1pYRFVdXVlRVFFV/company_mode_for_gnu_emacs][this screencast]].
97 * Quick key reference
99 *** In Scheme buffers:
101     |---------------------+-------------------------------------------------|
102     | C-c C-z             | Switch to REPL                                  |
103     | C-u C-c C-z         | Switch to REPL and current module               |
104     | C-c C-s             | Specify Scheme implementation for buffer        |
105     |---------------------+-------------------------------------------------|
106     | M-.                 | Go to definition of identifier at point         |
107     | M-,                 | Go back to where M-. was last invoked           |
108     | C-c C-e m           | Ask for a module and open its file              |
109     |---------------------+-------------------------------------------------|
110     | C-M-x               | Eval definition around point                    |
111     | C-c M-e             | Eval definition around point and switch to REPL |
112     | C-x C-e             | Eval sexp before point                          |
113     | C-c C-r             | Eval region                                     |
114     | C-c M-r             | Eval region and switch to REPL                  |
115     |---------------------+-------------------------------------------------|
116     | C-c C-m x           | Macro-expand definition around point            |
117     | C-c C-m e           | Macro-expand sexp before point                  |
118     | C-c C-m r           | Marcro-expand region                            |
119     | C-u C-c C-m [x,e,r] | (With prefix, macro expansions are recursive)   |
120     |---------------------+-------------------------------------------------|
121     | C-c C-k             | Compile and load current file                   |
122     | C-c C-l             | Load current file                               |
123     |---------------------+-------------------------------------------------|
124     | C-c C-d d           | See documentation for identifier at point       |
125     | C-c C-d m           | See a list of a module's exported identifiers   |
126     | C-c C-d a           | Toggle autodoc mode                             |
127     |---------------------+-------------------------------------------------|
128     | C-c<                | Show callers of procedure at point              |
129     | C-c>                | Show callees of procedure at point              |
130     | C-c C-x f           | See a generic's methods signatures              |
131     |---------------------+-------------------------------------------------|
132     | M-TAB               | Complete identifier at point                    |
133     | M-`, C-.            | Complete module name at point                   |
134     | TAB                 | Complete identifier at point or indent          |
135     |                     | (If `geiser-mode-smart-tab-p' is t)             |
136     |---------------------+-------------------------------------------------|
138 *** In the REPL
140     |-------------+----------------------------------------------------|
141     | C-c C-z     | Start Scheme REPL, or jump to previous buffer      |
142     | C-c C-q     | Kill Scheme process                                |
143     |-------------+----------------------------------------------------|
144     | M-.         | Edit identifier at point                           |
145     | TAB, M-TAB  | Complete identifier at point                       |
146     | M-`, C-.    | Complete module name at point                      |
147     |-------------+----------------------------------------------------|
148     | M-p, M-n    | Prompt history, matching current prefix            |
149     |-------------+----------------------------------------------------|
150     | C-c C-k     | Nuke REPL: use it if the REPL becomes unresponsive |
151     |-------------+----------------------------------------------------|
152     | C-c C-m     | Set current module                                 |
153     | C-c C-i     | Import module into current namespace               |
154     | C-c C-l     | Load scheme file                                   |
155     |-------------+----------------------------------------------------|
156     | C-c C-d C-d | See documentation for symbol at point              |
157     | C-c C-d C-m | See documentation for module                       |
158     | C-c C-d C-a | Toggle autodoc mode                                |
159     |-------------+----------------------------------------------------|
161 *** In the documentation browser:
163     |------------+----------------------------------------------|
164     | n, f       | Next page                                    |
165     | p, b       | Previous page                                |
166     | TAB, S-TAB | Next/previous link                           |
167     | k          | Kill current page and go to previous or next |
168     | g, r       | Refresh page                                 |
169     | c          | Clear browsing history                       |
170     | ., M-.     | Edit identifier at point                     |
171     | z          | Switch to REPL                               |
172     | q          | Bury buffer                                  |
173     |------------+----------------------------------------------|
175 *** In backtrace (evaluation/compile result) buffers:
177     - TAB, M-TAB for error navigation.
178     - q to bury buffer.