More robust lambda and keybinding to C-c \
[geiser.git] / doc / parens.texi
blobf3693fcc298f3073127e205c9c08a52b70b0b150
1 @node Between the parens, Cheat sheet, The REPL, Top
2 @chapter Between the parens
4 A good REPL is a must, but just about half the story of a good Scheme
5 hacking environment.  Well, perhaps a bit more than a half; but, at any
6 rate, one surely needs also a pleasant way of editing source code.  Don't
7 pay attention to naysayers: Emacs comes with an excellent editor
8 included for about any language on Earth, and just the best one when
9 that language is sexpy (especially if you use
10 @ifhtml
11 @ref{paredit,,Paredit}).
12 @end ifhtml
13 @ifnothtml
14 Paredit).
15 @end ifnothtml
16 Geiser's support for writing Scheme code adds to Emacs'
17 @code{scheme-mode}, rather than supplanting it; and it does so by means
18 of a minor mode (unimaginatively dubbed @code{geiser-mode}) that defines
19 a bunch of new commands to try and, with the help of the same Scheme
20 process giving you the REPL, make those Scheme buffers come to life.
22 @menu
23 * Activating Geiser::
24 * The source and the REPL::
25 * Documentation helpers::
26 * To eval or not to eval::
27 * To err perchance to debug::
28 * Jumping around::
29 * Geiser writes for you::
30 @end menu
32 @node Activating Geiser, The source and the REPL, Between the parens, Between the parens
33 @section Activating Geiser
35 @cindex geiser-mode
36 @img{geiser-mode, right} With Geiser installed following any of the
37 procedures described in @ref{The easy and quick way} or @ref{From the
38 source's mouth}, Emacs will automatically activate @i{geiser-mode} when
39 opening a Scheme buffer.  Geiser also instructs Emacs to consider files
40 with the extension @file{rkt} part of the family, so that, in principle,
41 there's nothing you need to do to ensure that Geiser's extensions will
42 be available, out of the box, when you start editing Scheme code.
44 Indications that everything is working according to plan include the
45 'Geiser' minor mode indicator in your mode-line and the appearance of a
46 new entry for Geiser in the menu bar.  If, moreover, the mode-line
47 indicator is the name of a Scheme implementation, you're indeed in a
48 perfect world; otherwise, don't despair and keep on reading: i'll tell
49 you how to fix that in a moment.
51 @cindex geiser-mode commands
52 The menu provides a good synopsis of everything Geiser brings to the
53 party, including those keyboard shortcuts we Emacsers love.  If you're
54 seeing the name of your favourite Scheme implementation in the
55 mode-line, have a running REPL and are comfortable with Emacs, you can
56 stop reading now and, instead, discover Geiser's joys by yourself.  I've
57 tried to make Geiser as self-documenting as any self-respecting Emacs
58 package should be.  If you follow this route, make sure to take a look at
59 Geiser's customization buffers (@kbd{M-x customize-group @key{RET}
60 geiser}): there's lot of fine-tuning available there.  You might also
61 want to take a glance at
62 @ifhtml
63 our @ref{Cheat sheet,,cheat sheet}.
64 @end ifhtml
65 @ifnothtml
66 the tables in @pxref{Cheat sheet, our cheat sheet}.
67 @end ifnothtml
69 Since @i{geiser-mode} is a minor mode, you can toggle it with
70 @kbd{M-x geiser-mode}, and control its activation in hooks with the
71 functions @code{turn-on-geiser-mode} and @code{turn-off-geiser-mode}.
72 If, for some reason i cannot fathom, you prefer @i{geiser-mode} not
73 to be active by default, customizing @code{geiser-mode-auto-p} to
74 @code{nil} will do the trick.
76 @cindex scheme file extensions
77 And if you happen to use a funky extension for your Scheme files that is
78 not recognised as such by Emacs, just tell her about it with:
80 @example
81 (add-to-list 'auto-mode-alist '("\\.funky-extension\\'" . scheme-mode))
82 @end example
84 @cindex useless wretch
85 Now, @i{geiser-mode} is just a useless wretch unless there's a running
86 Scheme process backing it up.  Meaning that virtually all the commands it
87 provides require a REPL up and running, preferably corresponding to
88 the correct Scheme implementation.  In the following section, we'll see
89 how to make sure that that's actually the case.
91 @node The source and the REPL, Documentation helpers, Activating Geiser, Between the parens
92 @section The source and the REPL
94 As i've already mentioned a couple of times, @i{geiser-mode} needs a
95 running REPL to be operative.  Thus, a common usage pattern will be
96 for you to first call @code{run-geiser}
97 @ifhtml
98 (or @ref{choosing-impl,,one of its variants}),
99 @end ifhtml
100 @ifnothtml
101 (or one of its variants, e.g. @code{run-guile}),
102 @end ifnothtml
103 and then open some Scheme files;
104 but there's nothing wrong in first opening a couple Scheme buffers and
105 then starting the REPL (you can even find it more convenient, since
106 pressing @kbd{C-c C-z} in a Scheme buffer will start the REPL for
107 you).  Since Geiser supports more than one Scheme implementation, though,
108 there's the problem of knowing which of them is to be associated with
109 each Scheme source file.  Serviceable as it is, @i{geiser-mode} will try
110 to guess the correct implementation for you, according to the algorithm
111 described below.
112 @ifhtml
113 If you find that Geiser is already guessing right the Scheme
114 implementation, feel free to skip to the @ref{switching-repl-buff,,next
115 subsection}.
116 @end ifhtml
118 @subsubheading How Geiser associates a REPL to your Scheme buffer
119 @cindex scheme implementation, choosing
120 @anchor{repl-association} To determine what Scheme implementation
121 corresponds to a given source file, Geiser uses the following algorithm:
123 @enumerate
124 @item
125 If the file-local variable @code{geiser-scheme-implementation} is
126 defined, its value is used.  A common way of setting buffer-local
127 variables is to put them in a comment near the beginning of the file,
128 surrounded by @code{-*-} marks, as in:
130 @example
131 ;; -*- geiser-scheme-implementation: guile -*-
132 @end example
134 @item
135 If you've customized @code{geiser-active-implementations} so that it's a
136 single-element
137 @ifhtml
138 list (as explained in @ref{choosing-impl,,here}),
139 @end ifhtml
140 @ifnothtml
141 list,
142 @end ifnothtml
143 that element is used as the chosen implementation.
144 @item
145 The contents of the file is scanned for hints on its associated
146 implementation.  For instance, files that contain a @code{#lang}
147 directive will be considered Racket source code, while those with a
148 @code{define-module} form in them will be assigned to a Guile REPL.
149 @item
150 The current buffer's file name is checked against the rules given in
151 @code{geiser-implementations-alist}, and the first match is applied.  You
152 can provide your own rules by customizing this variable, as explained
153 below.
154 @item
155 If we haven't been lucky this far and you have customized
156 @code{geiser-default-implementation} to the name of a supported
157 implementation, we'll follow your lead.
158 @item
159 See?  That's the problem of being a smart aleck: one's always outsmarted
160 by people around.  At this point, @i{geiser-mode} will humbly give up and
161 ask you to explicitly choose the Scheme implementation.
162 @end enumerate
164 As you can see in the list above, there are several ways to influence
165 Geiser's guessing by means of customizable variables.  The most direct (and
166 most impoverishing) is probably limiting the active implementations to a
167 single one, while customizing @code{geiser-implementations-alist} is the
168 most flexible (and, unsurprisingly, also the most complex).  Here's the
169 default value for the latter variable:
171 @example
172 (((regexp "\\.scm$") guile)
173  ((regexp "\\.ss$") racket)
174  ((regexp "\\.rkt$") racket))
175 @end example
177 @noindent
178 which describes the simple heuristic that files with @file{.scm} as
179 extension are by default associated to a Guile REPL while those ending
180 in @file{.ss} or @file{.rkt} correspond to Racket's implementation (with
181 the caveat that these rules are applied only if the previous heuristics
182 have failed to detect the correct implementation, and that they'll match
183 only if the corresponding implementation is active).  You can add rules
184 to @code{geiser-implementations-alist} (or replace all of them) by
185 customizing it.  Besides regular expressions, you can also use a
186 directory name; for instance, the following snippet:
188 @example
189 (eval-after-load "geiser-impl"
190   '(add-to-list 'geiser-implementations-alist
191                 '((dir "/home/jao/prj/frob") guile)))
192 @end example
194 @noindent
195 will add a new rule that says that any file inside my
196 @file{/home/jao/prj/frob} directory (or, recursively, any of its
197 children) is to be assigned to Guile.  Since rules are first matched,
198 first served, this new rule will take precedence over the default ones.
200 @subsubheading Switching between source files and the REPL
201 @cindex switching to REPL
202 @cindex switching to source
203 @anchor{switching-repl-buff} Once you have a working @i{geiser-mode},
204 you can switch from Scheme source buffers to the REPL or @kbd{C-c
205 C-z}.  Those shortcuts map to the interactive command
206 @code{switch-to-geiser}.
208 @cindex switching to module
209 If you use a numeric prefix, as in @kbd{C-u C-c C-z}, besides being
210 teleported to the REPL, the latter will switch to the namespace of the
211 Scheme source file, as if you had used @kbd{C-c C-m} in the REPL, with
212 the source file's module as argument;
213 cf. discussion in @altr{Switching context,,Switching context,. This}
214 command is also bound to @kbd{C-c C-a}.
216 Once you're in the REPL, the same @kbd{C-c C-z} shortcut will bring
217 you back to the buffer you jumped from, provided you don't kill the
218 Scheme process in between.  This is why the command is called
219 @i{switch-to-geiser} instead of @i{switch-to-repl}, and what makes it
220 really handy, if you ask me.
222 @cindex switching schemes
223 If for some reason you're not happy with the Scheme implementation that
224 Geiser has assigned to your file, you can change it with @kbd{C-c C-s},
225 and you probably should take a look at
226 @ifhtml
227 @ref{repl-association,,the previous subsection}
228 @end ifhtml
229 @ifnothtml
230 the previous subsection
231 @end ifnothtml
232 to make sure that Geiser
233 doesn't get confused again.
235 @subsubheading A note about context
236 As explained before (@pxref{Modus operandi}), all Geiser activities take
237 place in the context of the @i{current namespace}, which, for Scheme
238 buffers, corresponds to the module that the Scheme implementation
239 associates to the source file at hand (for instance, in Racket, there's
240 a one-to-one correspondence between paths and modules, while Guile
241 relies on explicit @code{define-module} forms in the source file).
243 Now that we have @code{geiser-mode} happily alive in our Scheme buffers
244 and communicating with the right REPL instance, let us see what it
245 can do for us, besides jumping to and fro.
247 @node Documentation helpers, To eval or not to eval, The source and the REPL, Between the parens
248 @section Documentation helpers
250 @subsubheading Autodoc redux
252 @cindex autodoc, in scheme buffers
253 The first thing you will notice by moving around Scheme source is that,
254 every now and then, the echo area lights up with the same autodoc
255 messages we know and love from our REPL forays.  This happens every
256 time the Scheme process is able to recognise an identifier in the
257 buffer, and provide information either on its value (for variables) or
258 on its arity and the name of its formal arguments (for procedures and
259 macros).  That information will only be available if the module the
260 identifier belongs to has been loaded in the running Scheme image.  So it
261 can be the case that, at first, no autodoc is shown for identifiers
262 defined in the file you're editing.  But as soon as you evaluate them
263 (either individually or collectively using any of the devices described
264 in @ref{To eval or not to eval}) their signatures will start appearing
265 in the echo area.
267 @cindex disabling autodoc
268 @cindex manual autodoc
269 Autodoc activation is controlled by a minor mode, @code{geiser-autodoc},
270 which you can toggle with @kbd{M-x geiser-autodoc-mode}, or its associated
271 keyboard shortcut, @kbd{C-c C-d a}.  That @t{/A} indicator in the
272 mode-line is telling you that autodoc is active.  If you prefer that it
273 be inactive by default (e.g., because you're connecting to a really
274 remote scheme and want to minimize network exchanges), just set
275 @code{geiser-mode-autodoc-p} to @code{nil} in your customization files.
276 Even when autodoc mode is off, you can use @code{geiser-autodoc-show},
277 bound by default to @kbd{C-c C-d s}, to show the autodoc string for the
278 symbol at point.
280 @cindex autodoc explained
281 @img{autodoc-scm, right} The way autodoc displays information deserves
282 some explanation.  It will first show the name of the module where the
283 identifier at hand is defined, followed by a colon and the identifier
284 itself.  If the latter corresponds to a procedure or macro, it will be
285 followed by a list of argument names, starting with the ones that are
286 required.  Then there comes a list of optional arguments, if any,
287 enclosed in parentheses.  When an optional argument has a default value
288 (or a form defining its default value), autodoc will display it after
289 the argument name.  When the optional arguments are keywords, their names
290 are prefixed with ``#:'' (i.e., their names @i{are} keywords).  An
291 ellipsis (@dots{}) serves as a marker of an indeterminate number of
292 parameters, as is the case with @i{rest} arguments or when autodoc
293 cannot fathom the exact number of arguments (this is often the case with
294 macros defined using @code{syntax-case}).  Another way in which autodoc
295 displays its ignorance is by using an underscore to display parameters
296 whose name is beyond its powers.
298 @img{autodoc-multi, right} It can also be the case that a function or
299 macro has more than one signature (e.g., functions defined using
300 @code{case-lambda}, or some @code{syntax-rules} macros, for which Geiser
301 has often the black magic necessary to retrieve their actual arities).
302 In those cases, autodoc shows all known signatures (using the above
303 rules for each one) separated by a vertical bar (|).
305 As you have already noticed, the whole autodoc message is enclosed in
306 parentheses.  After all, we're talking about Scheme here.
308 @cindex autodoc for variables
309 @img{autodoc-var, right} Finally, life is much easier when your cursor
310 is on a symbol corresponding to a plain variable: you'll see in the echo
311 area its name, preceded by the module where it's defined, and followed
312 by its value, with an intervening arrow for greater effect.  This time,
313 there are no enclosing parentheses (i hope you see the logic in my
314 madness).
316 @cindex autodoc customized
317 You can change the way Geiser displays the module/identifier combo by
318 customizing @code{geiser-autodoc-identifier-format}.  For example, if you
319 wanted a tilde surrounded by spaces instead of a colon as a separator,
320 you would write something like:
322 @example
323 (setq geiser-autodoc-identifier-format "%s ~ %s")
324 @end example
326 @noindent
327 in your Emacs initialisation files.  There's also a face
328 (@code{geiser-font-lock-autodoc-identifier}) that you can customize (for
329 instance, with @kbd{M-x customize-face}) to change the appearance of the
330 text.  And another one (@code{geiser-font-lock-autodoc-current-arg}) that
331 controls how the current argument position is highlighted.
333 @subsubheading Other documentation commands
335 @anchor{doc-browser}Sometimes, autodoc won't provide enough information
336 for you to understand what a function does.  In those cases, you can ask
337 Geiser to ask the running Scheme for further information on a given
338 identifier or module.
340 @cindex documentation for symbol
341 @cindex docstrings, maybe
342 For symbols, the incantation is @kbd{M-x geiser-doc-symbol-at-point}, or
343 @kbd{C-c C-d C-d} for short.  If the associated Scheme supports
344 docstrings (as, for instance, Guile does), you'll be teleported to a new
345 Emacs buffer displaying Geiser's documentation browser, filled with
346 information about the identifier, including its docstring (if any;
347 unfortunately, that an implementation supports docstrings doesn't mean
348 that they're used everywhere).
350 @imgc{docstring}
352 Pressing @kbd{q} in the documentation buffer will bring you back,
353 enlightened, to where you were.  There's also a handful of other
354 navigation commands available in that buffer, which you can discover by
355 means of its menu or via the good old @kbd{C-h m} command.  And feel free
356 to use the navigation buttons and hyperlinks that justify my calling
357 this buffer a documentation browser.
359 For Racket, which does not support docstrings out of the box, this
360 command will provide less information, but the documentation browser
361 will display the corresponding contract when it's available, as well as
362 some other tidbits for re-exported identifiers.
364 @imgc{docstring-racket}
366 You can also ask Geiser to display information about a module, in the
367 form of a list of its exported identifiers, using @kbd{C-c C-d C-m},
368 exactly as you would do in @altr{repl-mod,the REPL,The REPL,.}
370 In both cases, the documentation browser will show a couple of buttons
371 giving you access to further documentation.  First, you'll see a button
372 named @i{source}: pressing it you'll jump to the symbol's definition.
373 The second button, dubbed @i{manual}, will open the Scheme
374 implementation's manual page for the symbol at hand.  For Racket, that
375 will open your web browser displaying the corresponding reference's page
376 (using Emacs' @code{browser-url} command), while in Guile a lookup will
377 be performed in the texinfo manual.
379 @cindex Guile info nodes
380 For Guile, the manual lookup uses the info indexes in the standard
381 Guile info nodes, which are usually named ``guile'' or ``guile-2.0''.
382 If yours are named differently, just add your name to the customizable
383 variable @code{geiser-guile-manual-lookup-nodes}.
385 A list of all navigation commands in the documentation browser is
386 available in
387 @altr{Documentation browser,our cheat-sheet,Documentation browser,.}
389 @cindex opening manual pages
390 You can also skip the documentation browser and jump directly to the
391 manual page for the symbol at point with the command
392 @code{geiser-doc-look-up-manual}, bound to @kbd{C-c C-d i}.
394 @node To eval or not to eval, To err perchance to debug, Documentation helpers, Between the parens
395 @section To eval or not to eval
397 @cindex philosophy
398 @cindex incremental development
399 One of Geiser's main goals is to facilitate incremental development.  You
400 might have noticed that i've made a big fuss of Geiser's ability to
401 recognize context, by being aware of the namespace where its operations
402 happen.
404 That awareness is especially important when evaluating code in your
405 scheme buffers, using the commands described below.  They allow you to
406 send code to the running Scheme with a granularity ranging from whole
407 files to single s-expressions.  That code will be evaluated in the module
408 associated with the file you're editing, allowing you to redefine values
409 and procedures to your heart's (and other modules') content.
411 @cindex incremental development, evil
412 Macros are, of course, another kettle of fish: one needs to re-evaluate
413 uses of a macro after redefining it.  That's not a limitation imposed by
414 Geiser, but a consequence of how macros work in Scheme (and other
415 Lisps).  There's also the risk that you lose track of what's actually
416 defined and what's not during a given session.  But,
417 @uref{http://programming-musings.org/@/2009/03/29/@/from-my-cold-prying-hands/,in
418 my opinion}, those are limitations we lispers are aware of, and they
419 don't force us to throw the baby with the bathwater and ditch
420 incremental evaluation.  Some people disagree; if you happen to find
421 @uref{http://blog.racket-lang.org/@/2009/@/03/@/drscheme-repl-isnt-lisp.html,
422 their arguments} convincing, you don't have to throw away Geiser
423 together with the baby: @kbd{M-x geiser-restart-repl} will let you
424 restart the REPL as many times as you see fit.
426 @cindex evaluation
427 @cindex incremental development, not evil
428 For all of you bearded old lispers still with me, here are some of the
429 commands performing incremental evaluation in Geiser.
431 @code{geiser-eval-last-sexp}, bound to @kbd{C-x C-e}, will eval the
432 s-expression just before point.
434 @code{geiser-eval-definition}, bound to @kbd{C-M-x}, finds the topmost
435 definition containing point and sends it for evaluation.  The variant
436 @code{geiser-eval-definition-and-go} (@kbd{C-c M-e}) works in the same
437 way, but it also teleports you to REPL after the evaluation.
439 @code{geiser-eval-region}, bound to @kbd{C-c C-r}, evals the current
440 region.  Again, there's an @i{and-go} version available,
441 @code{geiser-eval-region-and-go}, bound to @kbd{C-c M-r}.
443 @cindex evaluating images
444 @cindex image display
445 For all the commands above, the result of the evaluation is displayed in
446 the minibuffer, unless it causes a (Scheme-side) error (@pxref{To err
447 perchance to debug}), or, for schemes supporting them (such as Racket),
448 the evaluation yields an image, in which case you'll see it in popping
449 up in the Geiser debug buffer (if your Emacs runs under the auspices of
450 a graphical toolkit), or via an external viewer if you set
451 @c{geiser-image-viewer} to the path of an appropriate visualization
452 program (see also @ref{Seeing is believing} for more on image support).
454 At the risk of repeating myself, i'll remind you that all these
455 evaluations will take place in the namespace of the module corresponding
456 to the Scheme file from which you're sending your code, which, in
457 general, will be different from the REPL's current module.  And, if all
458 goes according to plan, (re)defined variables and procedures should be
459 immediately visible inside and, if exported, outside their module.
461 Besides evaluating expressions, definitions and regions, you can also
462 macro-expand them.  The corresponding key bindings start with the prefix
463 @kbd{C-c C-m} and end, respectively, with @kbd{C-e}, @kbd{C-x} and
464 @kbd{C-r}.  The result of the macro expansion always appears in a pop up
465 buffer.
467 @node To err perchance to debug, Jumping around, To eval or not to eval, Between the parens
468 @section To err: perchance to debug
470 @cindex to err is schemey
471 @cindex backtraces
472 When an error occurs during evaluation, it will be reported according to
473 the capabilities of the underlying Scheme REPL.
475 @cindex error buffer
476 In Racket, you'll be presented with a backtrace, in a new buffer where
477 file paths locating the origin of the error are click-able (you can
478 navigate them using the @key{TAB} key, and use @key{RET} or the mouse to
479 jump to the offending spot; or invoke Emacs' stock commands
480 @code{next-error} and @code{previous-error}, bound to @kbd{M-g n} and
481 @kbd{M-g p} by default).
483 @imgc{eval-error}
485 The Racket backtrace also highlights the exception type, making it
486 click-able.  Following the link will open the documentation corresponding
487 to said exception type.  Both the error and exception link faces are
488 customizable (@code{geiser-font-lock-error-link} and
489 @code{geiser-font-lock-doc-link}).
491 On the other hand, Guile's reaction to evaluation errors is different:
492 it enters the debugger in its REPL.  Accordingly, the REPL buffer will
493 pop up if your evaluation fails in a Guile file, and the error message
494 and backtrace will be displayed in there, again click-able and all.  But
495 there you have the debugger at your disposal, with the REPL's current
496 module set to that of the offender, and a host of special debugging
497 commands that are described in Guile's fine documentation.
499 @imgc{guile-eval-error}
501 In addition, Guile will sometimes report warnings for otherwise
502 successful evaluations.  In those cases, it won't enter the debugger, and
503 Geiser will report the warnings in a debug buffer, as it does for
504 Racket.  You can control how picky Guile is reporting warnings by
505 customizing the variable @code{geiser-guile-warning-level}, whose
506 detailed docstring (which see, using, e.g. @kbd{C-h v}) allows me to
507 offer no further explanation here.  The customization group
508 @i{geiser-guile} is also worth a glance, for a couple of options to
509 fine-tune how Geiser interacts with Guile's debugger (and more).  Same
510 thing for racketeers and @i{geiser-racket}.
512 @node Jumping around, Geiser writes for you, To err perchance to debug, Between the parens
513 @section Jumping around
515 @cindex jumping in scheme buffers
516 This one feature is as sweet as it is easy to explain: @kbd{M-.}
517 (@code{geiser-edit-symbol-at-point}) will open the file where the
518 identifier around point is defined and land your point on its
519 definition.  To return to where you were, press @kbd{M-,}
520 (@code{geiser-pop-symbol-stack}).  This command works also for module
521 names: Geiser first tries to locate a definition for the identifier at
522 point and, if that fails, a module with that name; if the latter
523 succeeds, the file where the module is defined will pop up.
525 Sometimes, the underlying Scheme will tell Geiser only the file where
526 the symbol is defined, but Geiser will use some heuristics (read,
527 regular expressions) to locate the exact line and bring you there.  Thus,
528 if you find Geiser systematically missing your definitions, send a
529 message to the @email{geiser-users@@nongnu.org, mailing list}, and we'll
530 try to make the algorithm smarter.
532 @cindex jumping customized
533 You can control how the destination buffer pops up by setting
534 @code{geiser-edit-symbol-method} to either @code{nil} (to open the file
535 in the current window), @code{'window} (other window in the same frame)
536 or @code{'frame} (in a new frame).
538 @node Geiser writes for you,  , Jumping around, Between the parens
539 @section Geiser writes for you
541 @cindex completion in scheme buffers
542 No self-respecting programming mode would be complete without
543 completion.  In geiser-mode, identifier completion is bound to
544 @kbd{M-@key{TAB}}, and will offer all visible identifiers starting with
545 the prefix before point.  Visible here means all symbols imported or
546 defined in the current namespace plus locally bound ones.  E.g., if
547 you're at the end of the following partial expression:
549 @example
550 (let ((default 42))
551   (frob def
552 @end example
554 @noindent
555 and press @kbd{M-@key{TAB}}, one of the possible completions will be
556 @code{default}.
558 @cindex partial completion
559 After obtaining the list of completions from the running Scheme, Geiser
560 uses the standard Emacs completion machinery to display them.  That
561 means, among other things, that partial completion is available: just
562 try to complete @code{d-s} or @code{w-o-t-s} to see why this is a good
563 thing.  Partial completion won't work if you have disabled it globally in
564 your Emacs configuration: if you don't know what i'm talking about,
565 never mind: Geiser's partial completion will work for you out of the
566 box.
568 @cindex smart tabs
569 If you find the @kbd{M} modifier annoying, you always have the option to
570 activate @code{geiser-smart-tab-mode}, which will make the @key{TAB} key
571 double duty as the regular Emacs indentation command (when the cursor is
572 not near a symbol) and Geiser's completion function.  If you want this
573 smarty pants mode always on in Scheme buffers, customize
574 @code{geiser-mode-smart-tab-p} to @code{t}.
576 @cindex completion for module names
577 Geiser also knows how to complete module names: if no completion for the
578 prefix at point is found among the currently visible bindings, it will
579 try to find a module name that matches it.  You can also request
580 explicitly completion only over module names using @kbd{M-`} (that's a
581 backtick).
583 Besides completion, there's also this little command,
584 @code{geiser-squarify}, which will toggle the delimiters of the
585 innermost list around point between round and square brackets.  It is
586 bound to @kbd{C-c C-e [}.  With a numeric prefix (as in, say, @kbd{M-2
587 C-c C-e [}), it will perform that many toggles, forward for positive
588 values and backward for negative ones.
590 @c Local Variables:
591 @c mode: texinfo
592 @c TeX-master: "geiser"
593 @c End: