merge Justin's changes
[sepia.git] / sepia.info
blob5a9c48df627b9f2eaef67c8ae86d2e6bab688b24
1 This is Sepia.info, produced by makeinfo version 4.8 from sepia.texi.
3 INFO-DIR-SECTION Emacs
4 START-INFO-DIR-ENTRY
5 * Sepia: (sepia).    Simple Emacs Perl Integration.
6 END-INFO-DIR-ENTRY
7    Copyright (C) 2005-2010 Sean O'Rourke.  All rights reserved, some
8 wrongs reversed.  This module is distributed under the same terms as
9 Perl.
11 \x1f
12 File: Sepia.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
14 SEPIA
15 *****
17    Sepia is a set of Perl development tools for Emacs supporting code
18 navigation and interactive evaluation.
20 * Menu:
22 * Introduction::
23 * Editing::
24 * Interactive Perl::
25 * CPAN browsing::
26 * Customization::
27 * Internals::
28 * FAQ::
29 * Credits::
30 * Function Index::
31 * Variable Index::
33 \x1f
34 File: Sepia.info,  Node: Introduction,  Next: Editing,  Prev: Top,  Up: Top
36 1 Introduction
37 **************
39 Sepia is a set of tools for Perl development in Emacs.  Its goal is to
40 extend CPerl mode to support fast code navigation and interactive
41 development.  It is inspired by Emacs' current support for a number of
42 other languages, including Lisp, Python, and Emacs Lisp.
44 * Menu:
46 * Getting Started::
47 * Philosophy::
48 * Related Work::
50 \x1f
51 File: Sepia.info,  Node: Getting Started,  Next: Philosophy,  Prev: Introduction,  Up: Introduction
53 1.1 Getting Started
54 ===================
56 To install Sepia, its Emacs Lisp files must be in Emacs' `load-path',
57 and the `lib' directory must be in Perl's `@INC'.  Assuming that Sepia
58 has been unpacked in `~/sepia', it can be installed by adding the
59 following lines to `~/.emacs':
61      (add-to-list 'load-path "~/sepia")
62      (setq sepia-perl5lib (list (expand-file-name "~/sepia/lib")))
63      (defalias 'perl-mode 'sepia-mode)
64      (require 'sepia)
66    Then to bring up the interactive Perl prompt, type `M-x sepia-repl'.
68 \x1f
69 File: Sepia.info,  Node: Philosophy,  Next: Related Work,  Prev: Getting Started,  Up: Introduction
71 1.2 Philosophy
72 ==============
74 A development environment should support three activities: code
75 spelunking, interaction, and customization.  Emacs as an environment for
76 developing Emacs Lisp thoroughly supports all of them: It has commands
77 to visit individual functions' code and documentation, commands to
78 evaluate or step through expressions, and an architecture that
79 encourages customization in Emacs Lisp.  As an environment for Perl,
80 however, it is lacking: there is limited interactivity with the Perl
81 debugger, and reasonable documentation browsing, but no support for
82 navigating, editing, and re-evaluating code.  Sepia attempts to remedy
83 the situation.
85    Modern IDEs also support these three activities, but do so awkwardly.
86 Rather than having functions to visit definitions (`find-function') and
87 search for functions (`apropos'), they clutter the screen with class
88 and file trees.  Rather than supporting interactive evaluation of small
89 pieces of code, they perform background semantic checking on whole
90 projects and highlight errors.  Rather than allowing minor
91 customizations to grow organically into features, they support limited
92 configuration files and baroque plug-in APIs(1).  Sepia tries to adhere
93 to the apparent Emacs philosophy that rich semantic information should
94 be unobtrusive, and that the best way to build working code is to start
95 by experimenting with small pieces.
97    Language support packages for Emacs vary widely in the degree to
98 which they make use of or replace existing Emacs features.  Minimal
99 modes provide keyword-based syntax highlighting and an unadorned comint
100 buffer as an interpreter.  Others provide their own specialized
101 equivalents of comint, eldoc, completion, and other Emacs features.
102 Sepia takes a third approach by trying to do as much as possible with
103 existing Emacs features, even when they are not optimal for Perl.  For
104 example, it uses comint to communicate with the subprocess, eldoc to
105 display documentation, and grep to list source locations.
107    This approach has three advantages: First, it maximizes the number of
108 features that can be supported with limited development time.  Second,
109 it respects users' settings.  A seasoned Emacs user may have changed
110 hundreds of settings, so a mode that reimplements features will have to
111 support equivalent settings, and will force the user to re-specify them.
112 Finally, this approach respects decades of development spent, as Neal
113 Stephenson put it, "focused with maniacal intensity on the deceptively
114 simple-seeming problem of editing text."  Many non-obvious choices go
115 into making a polished interface, and while a reimplementation gets rid
116 of accumulated cruft, it must rediscover these hidden trade-offs.
118    Anyways, I hope you enjoy using Sepia.  Its development style is
119 strange for someone used Perl's typical mix of one-liners and
120 edit-save-run, but once you are accustomed to it, you may find it very
121 effective.
123    ---------- Footnotes ----------
125    (1) In my brief experience with Visual Studio, I was struck by the
126 fact that I saw several toolbars, a couple of navigation windows, and a
127 tiny view of the actual code.  Sometimes a tooltip would obscure part
128 of that tiny window.
130 \x1f
131 File: Sepia.info,  Node: Related Work,  Prev: Philosophy,  Up: Introduction
133 1.3 Related Work
134 ================
136 A number of more-or-less related Emacs extensions are currently under
137 development.  Here is a list of the ones I have heard about, along with
138 my brief impression of how they differ from Sepia.  Since I use none of
139 them regularly, these impressions should be taken with a grain of salt.
141 `PDE'
142      PDE is similar to Sepia in offering an interactive Lisp-like
143      development environment interfacing with a long-running Perl
144      process.  It seems more ambitious, and therefore a bit more
145      invasive.
147      `http://search.cpan.org/search?query=pde&mode=module'
149 `Devel::PerlySense'
150      Devel::PerlySense offers a more Eclipse-like development
151      environment, with offline code analysis via PPI.
153      `http://search.cpan.org/search?query=devel::perlysense&mode=module'
155 `Emacs::EPL'
156      Emacs::EPL is a low-level IPC interface between Emacs and Perl.
157      Sepia was originally based on Emacs::EPL, but the current
158      `comint'-based implementation proved more maintainable.
160      `http://search.cpan.org/search?query=emacs::epl&mode=module'
163 \x1f
164 File: Sepia.info,  Node: Editing,  Next: Interactive Perl,  Prev: Introduction,  Up: Top
166 2 Editing
167 *********
169 Sepia's first contribution is a set of commands to explore a Perl
170 codebase.  These include commands to browse and display documentation,
171 to find function definitions, and to query a cross-reference database of
172 function and variable uses.  Sepia also provides intelligent symbol
173 completion.
175 * Menu:
177 * Completion::
178 * Navigation::
179 * Documentation::
180 * Other commands::
182 \x1f
183 File: Sepia.info,  Node: Completion,  Next: Navigation,  Prev: Editing,  Up: Editing
185 2.1 Completion
186 ==============
188 Sepia implements partial-word completion that communicates with the
189 inferior Perl process.  For example, `%S:X:v_u' completes to
190 `%Sepia::Xref::var_use' when Sepia is loaded.  This completion only
191 operates on functions and global variables known to the Perl
192 interpreter, so it works best when code and interpreter are in sync.
194    More precisely, completion examines the text before point and tries
195 each of the following in turn, using the first successful approach:
197   1. If the text looks like a method call (e.g. `$object->f' or
198      `Class->f'), complete on methods.
200   2. If it looks like a variable (e.g. `%hash' or `$scalar'), complete
201      first on lexical, then global variables.
203   3. Complete on modules and functions.
205   4. Otherwise, complete on Perl built-in operators.
207    For each of the first three cases, completions candidates are first
208 generated by splitting the text on characters `[:_]' and matching the
209 resulting word parts.  For example, `X:a_b' will complete to all
210 symbols matching `^X[^:]*:+a[^:_]*_b' such as `Xref::a_bug' and
211 `X::always_bites_me'.  If the module parts of the input match a module
212 exactly and completions exist, they are not expanded.  For example,
213 `X:a' will expand only to `X::aa' when `X::aa' and `Xx::aa' exist.  If
214 no matches result, the text is treated as an acronym.  For example,
215 `dry' will complete to `dont_repeat_yourself'.  _Note: partial-word
216 completion is not currently supported for lexicals._
218    Completion is performed by the following commands:
219 `M-x sepia-complete-symbol'
220      Complete the symbol before point as described above.  This is
221      always case-sensitive, independent of `completion-ignore-case'.
223 `TAB'
224 `M-x sepia-indent-or-complete'
225      First try to reindent the current line.  If its indentation does
226      not change, then try to expand an abbrev at point (unless
227      `sepia-indent-expand-abbrev' is `nil').  If no abbrev is expanded,
228      then call `sepia-complete-symbol'.
231 \x1f
232 File: Sepia.info,  Node: Navigation,  Next: Documentation,  Prev: Completion,  Up: Editing
234 2.2 Navigation
235 ==============
237 Sepia provides several commands for navigating program source.  All of
238 them rely on information from the inferior Perl process, so it is
239 important both that it be running, and that its internal representation
240 of the program match the program source.  The commands marked (Xref)
241 below also rely on a cross-reference database, which must be explicitly
242 rebuilt by calling `xref-rebuild' when the program changes.
244    There are two basic kinds of navigation commands.  The first kind
245 jumps directly to the first matching location when possible, prompting
246 only if no such location is found.  These commands find only a single
247 location.
249 `M-. M-.'
250 `M-x sepia-dwim'
251      Guess what kind of identifier is at point, and try to do the right
252      thing: for a function, find its definition(s); for a variable,
253      find its uses; for a module, view its documentation; otherwise,
254      prompt for the name of a function to visit.  `sepia-dwim'
255      automatically goes to the first function definition or variable
256      use found.
258 `M-. l'
259 `M-x sepia-location'
260      Jump directly to the definition of the function at point,
261      prompting if point is not on a known function.  If multiple
262      definitions are found, choose one arbitrarily.  This function is
263      similar to `sepia-defs', and the two should probably be merged.
265 `M-. j'
266 `M-x sepia-jump-to-symbol'
267      Navigate to a function using "ido" interactive completion.  Within
268      interactive completion, press <:> to descend into a package, <DEL>
269      to ascend to a parent package, and <RET> to go to the
270      currently-selected function.
273    The second kind of navigation commands always prompts the user -
274 though usually with a sensible default value - and finds multiple
275 locations.  When called with a prefix argument, these commands present
276 their results in a `grep-mode' buffer.  When called _without_ a prefix
277 argument, they place all results on the found-location ring and jump
278 directly to the first.  The remaining locations can be cycled through by
279 calls to `sepia-next'.
281 `M-. f NAME <RET>'
282 `M-x sepia-defs'
283      Find definition(s) of function NAME.
285 `M-. m NAME <RET>'
286 `M-x sepia-module-find NAME <RET>'
287      Find the source of module NAME.
289 `M-. a REGEXP <RET>'
290 `M-x sepia-apropos REGEXP <RET>'
291      Find definitions of all functions whose names match REGEXP.
293 `M-x sepia-apropos-module REGEXP <RET>'
294      Find all installed modules matching REGEXP.  This function may be
295      slow the first time it is called, because it has to build a list of
296      installed modules.
298 `M-. c NAME <RET>'
299 `M-x sepia-callers NAME <RET>'
300      (Xref) Find calls to function NAME.
302 `M-. C NAME <RET>'
303 `M-x sepia-callees NAME <RET>'
304      (Xref) Find the definitions of functions called by NAME.
306 `M-. v NAME <RET>'
307 `M-x sepia-var-uses NAME <RET>'
308      (Xref) Find uses of the global variable NAME.
310 `M-. V NAME <RET>'
311 `M-x sepia-var-defs NAME <RET>'
312      (Xref) Find definitions of global variable NAME.  Since Perl's
313      global variables are not declared, this is rarely useful
316    Finally, there are several other navigation-related commands that do
317 not fit into either of the above categories.
319 `M-,'
320 `M-x sepia-next'
321      Cycle through the definitions found by the previous <M-.> search.
323 `M-. r'
324 `M-x sepia-rebuild'
325      Rebuild the cross-reference database by walking the op-tree and
326      stashes.
328 `M-. t'
329 `M-x find-tag'
330      Execute the `find-tag' command typically bound to <M-.>.
333 \x1f
334 File: Sepia.info,  Node: Documentation,  Next: Other commands,  Prev: Navigation,  Up: Editing
336 2.3 Documentation
337 =================
339 Sepia can be used to browse installed modules' documentation, to format
340 and display the current buffer's POD, and to browse the list of modules
341 installed on the system.
343 `M-. d NAME <RET>'
344 `M-x sepia-perldoc-this'
345      View documentation for module NAME or Perl manual page NAME.
347 `C-c C-d'
348 `M-x sepia-view-pod'
349      Format and view the current buffer's documentation.
351 `sepia-package-list'
352      Browse a tree of installed packages.  This lists only the top-level
353      packages from installed distributions, so if package `My::Stuff'
354      also provides `My::Stuff::Details', it will not be displayed.  When
355      Emacs-w3m is available, each module is linked to its documentation.
357 `sepia-module-list'
358      Browse a tree of both top-level and internal packages, like
359      `sepia-package-list'.
362    Sepia also integrates with eldoc (at least in GNU Emacs >= 22).
363 Documentation for Perl operators and control structures is taken from
364 CPerl mode.  Sepia will also display documentation for user-defined
365 functions if their POD is formatted in the standard way, with functions
366 described in a "=head2" or "=item" entry.  To load user documentation,
367 visit the relevant file and type `M-x sepia-doc-update'.
369    If `Module::CoreList' is available, Sepia's eldoc function will also
370 display the first version of Perl with which a module was shipped.
371 This is intended to give the programmer a sense of when he is creating
372 external dependencies.
374 \x1f
375 File: Sepia.info,  Node: Other commands,  Prev: Documentation,  Up: Editing
377 2.4 Other commands
378 ==================
380 `M-x sepia-rename-lexical'
381      Rename a variable in the function at point, querying for each
382      replacement when called with a prefix argument.  Currently, this
383      is only a thin wrapper around `query-replace'.
385 \x1f
386 File: Sepia.info,  Node: Interactive Perl,  Next: CPAN browsing,  Prev: Editing,  Up: Top
388 3 Interactive Perl
389 ******************
391 Sepia's second main contribution is an interactive interface (REPL) to
392 an inferior Perl process.  The interface is based on GUD mode, and
393 inherits many of its bindings; this chapter discusses only the Sepia
394 extensions.  To start or switch to the repl, type `M-x sepia-repl'.  As
395 in Sepia mode, <TAB> in the REPL performs partial-word completion with
396 `sepia-complete-symbol'.
398    Sepia also provides a number of other ways to evaluate pieces of
399 code in Perl, and commands to process buffer text using the inferior
400 process.
402    Finally, Sepia comes with the `sepl' program, a standalone REPL that
403 can be run from the command-line, and provides many features of the
404 Emacs-based REPL.
406 * Menu:
408 * Shortcuts::
409 * Debugger::
410 * Evaluation::
411 * Mutilation::
412 * Scratchpad::
414 \x1f
415 File: Sepia.info,  Node: Shortcuts,  Next: Debugger,  Prev: Interactive Perl,  Up: Interactive Perl
417 3.1 Shortcuts
418 =============
420 "Shortcuts" are commands handled specially by the REPL rather than
421 being evaluated as Perl code.  They either communicate with the REPL
422 function, or provide a convenient interface to Sepia variables and
423 functions.  Shortcuts are prefixed by a comma (<,>), and may be
424 abbreviated to the shortest unique prefix.  The debugger defines
425 additional shortcuts (*Note Debugger::.).
427 `break FILE:LINE [EXPR]'
428      Set a breakpoint in FILE at LINE.  If EXPR is supplied, stop only
429      if it evaluates to true.
431 `cd DIR'
432      Change Perl's current directory to DIR.
434 `debug [VAL]'
435      Turn Sepia debugger hook on or off, or toggle if VAL is missing.
437 `define NAME ['DOC'] BODY...'
438      Define NAME as a shortcut for Perl code BODY, with optional
439      documentation DOC, surrounded by single quotes.  BODY is passed
440      the raw command-line text as its first argument.
442 `format TYPE'
443      Set the output format to TYPE, either "dumper" (using
444      `Data::Dumper'), "dump" (`Data::Dump'), "yaml" (`YAML'), "peek"
445      (`Devel::Peek'), "dumpvar" (`dumpvar.pl', somewhat rough), or
446      "plain" (stringification).  Default: "dumper".
448      Note that this setting is independent of `$COLUMNATE' and
449      `$STRINGIFY'.
451 `help'
452      Display a list of shortcuts.
454 `load [FILE]'
455      Reload saved variables from FILE (or `~/.sepia-save'), created by
456      `save'.
458 `lsbreak'
459      List breakpoints.
461 `lsmod [PATTERN]'
462      List currently-loaded modules matching optional PATTERN.
464 `methods NAME [REGEXP]'
465      Display a list of functions defined in package NAME and its
466      `ISA'-ancestors matching optional pattern REGEXP.
468 `package NAME'
469      Set the default evaluation package to NAME.
471 `pwd'
472      Show the process's current working directory.
474 `quit'
475      Exit the inferior Perl process.
477 `reload [MODULE | /PATTERN/]'
478      Reload MODULE (but not its dependencies), or all modules matching
479      PATTERN.
481 `freload MODULE'
482      Reload MODULE and all of its dependencies.
484 `restart'
485      Reload `Sepia.pm' and recursively invoke the REPL.  This command is
486      mostly of interest when working on Sepia itself, and will fail
487      catastrophically if `Sepia.pm' fails to compile.
489 `save [PATTERN [FILE]]'
490      Save variables matching PATTERN (or all variables) to FILE (or
491      `~/.sepia-save') in `Storable' format.  Note that because saving
492      magic variables can have unpredictable results, using `save'
493      without a pattern argument is risky.  Sepia excludes common magic
494      variables and dangerous packages, but its list is not foolproof.
496 `shell [COMMAND]'
497      Execute shell command COMMAND, displaying its standard output and
498      standard error.
500 `size [PACKAGE [REGEXP]]'
501      List the variables in PACKAGE (or the current package) along with
502      their total sizes.  This requires the `Devel::Size' module.
504 `strict [VAL]'
505      Set evaluation strictness to VAL, or toggle it if VAL is not
506      given.  Note that turning strictness off and on clears the REPL's
507      lexical environment.
509 `test [FILE]'
510      Run tests in the current directory.  If FILE is given, only run
511      test FILE or `t/FILE'
513 `time [VAL]'
514      Set time display to VAL, or toggle it if VAL is not given.  With
515      time display enabled, Sepia will use `BSD::Resource' and/or
516      `Time::HiRes' to display wall clock time and CPU usage for the
517      previous command as part of the prompt.
519 `undef NAME'
520      Undefine shortcut NAME.  *Warning*: this can equally be used to
521      remove built-in shortcuts.
523 `wantarray [VAL]'
524      Set the evaluation context to VAL: `@' means array, `$' means
525      scalar, and anything else means void.
527 `who PACKAGE [REGEXP]'
528 `who [REGEXP]'
529      List identifiers in PACKAGE (main by default) matching optional
530      REGEXP.
533 \x1f
534 File: Sepia.info,  Node: Debugger,  Next: Evaluation,  Prev: Shortcuts,  Up: Interactive Perl
536 3.2 Debugger
537 ============
539 Sepia uses Perl's debugger hooks and GUD mode to support conditional
540 breakpoints and single-stepping, and overrides Perl's `die()' to invoke
541 the debugger rather than unwind the stack.  This makes it possible to
542 produce a backtrace, inspect and modify global variables, and even
543 continue execution when a program tries to kill itself.  If the
544 PadWalker module is available, Sepia also provides functions to inspect
545 and modify lexical variables.
547    The debugger has its own set of shortcuts, also prefixed by a comma.
549 `backtrace'
550      Show a backtrace.
552 `delete'
553      Delete the current breakpoint.
555 `down N'
556 `up N'
557      Move the current stack frame up or down by N (or one) frames.
559 `inspect [N]'
560      Inspect lexicals in the current frame or frame N, counting upward
561      from 1.
563 `next [N]'
564      Advance N (or one) lines, skipping subroutine calls.
566 `quit'
567 `die'
568 `warn'
569      Continue as the program would have executed without debugger
570      intervention, dying if the debugger was called from `die()'.
572 `return EXPR'
573      Continue execution as if `die()' had returned the value of EXPR,
574      which is evaluated in the global environment.
576 `step [N]'
577      Step forward N (or one) lines, descending into subroutines.
579 `xreturn SUB EXPR'
580      Return EXPR from the innermost call to SUB.  This is a somewhat
581      dangerous and experimental feature, but is probably more useful
582      than returning a value from `die()'.
585 \x1f
586 File: Sepia.info,  Node: Evaluation,  Next: Mutilation,  Prev: Debugger,  Up: Interactive Perl
588 3.3 Evaluation
589 ==============
591 When interactive Perl is running, Sepia can evaluate regions of code in
592 the inferior Perl process.  The following commands assume that this
593 process has already been started by calling `sepia-repl'.
595 `C-M-x'
596 `M-x sepia-eval-defun'
597      Evaluate the function around point in the inferior Perl process.
598      If it contains errors, jump to the location of the first.
600 `C-c C-l'
601 `M-x sepia-load-file'
602      Save the current buffer, then reload its file and if warnings or
603      errors occur, display an error buffer.  With a prefix argument,
604      also rebuild the cross-reference index.
606 `C-c e'
607 `M-x sepia-eval-expression <RET> EXPR <RET>'
608      Evaluate EXPR in scalar context and echo the result.  With a
609      prefix argument, evaluate in list context.
611 `C-c!'
612 `sepia-set-cwd'
613      Set the REPL's working directory to the current buffer's directory.
616 \x1f
617 File: Sepia.info,  Node: Mutilation,  Next: Scratchpad,  Prev: Evaluation,  Up: Interactive Perl
619 3.4 Mutilation
620 ==============
622 Sepia contains several functions to operate on regions of text using the
623 interactive Perl process.  These functions can be used like standard
624 one-liners (e.g. `perl -pe ...'), with the advantage that all of the
625 functions and variables in the interactive session are available.
627 `M-x sepia-perl-pe-region <RET> CODE <RET>'
628      Evaluate CODE on each line in the region with `$_' bound to the
629      line text, collecting the resulting values of `$_'.  With a prefix
630      argument, replace the region with the result.
632 `M-x sepia-perl-ne-region <RET> CODE <RET>'
633      Evaluate CODE as above, but collect the results instead.
635 `M-x sepia-perlize-region <RET> CODE <RET>'
636      Evaluate CODE once with `$_' bound to the entire region,
637      collecting the final value of `$_'.  With a prefix argument,
638      replace the region.
641 \x1f
642 File: Sepia.info,  Node: Scratchpad,  Prev: Mutilation,  Up: Interactive Perl
644 3.5 Scratchpad
645 ==============
647 Sepia also supports a scratchpad, another form of interaction inspired
648 by Emacs' `*scratch*' buffer.  To create or switch to the scratchpad,
649 type `M-x sepia-scratch'.  Scratchpad mode is exactly like Sepia mode,
650 except <C-j> evaluates the current line and prints the result on the
651 next line.
653 \x1f
654 File: Sepia.info,  Node: CPAN browsing,  Next: Customization,  Prev: Interactive Perl,  Up: Top
656 4 CPAN browsing
657 ***************
659 Sepia has rudimentary support for browsing documentation and installing
660 modules from CPAN.  Modules whose names, descriptions, or authors match
661 a query are displayed in a `*sepia-cpan*' buffer, in which the
662 following commands are available:
665 `M-x sepia-cpan-search <RET> PATTERN <RET>'
666      List modules whose names match PATTERN.
669 `M-x sepia-cpan-desc <RET> PATTERN <RET>'
670      List modules whose names or descriptions match PATTERN.
673 `M-x sepia-cpan-list <RET> NAME <RET>'
674      List modules authored by NAME.
677 `M-x sepia-cpan-readme <RET> MODULE <RET>'
678      Fetch and display MODULE's README file.
681 `M-x sepia-cpan-doc <RET> MODULE <RET>'
682      Browse MODULE's documentation on `http://search.cpan.org'.
685 `M-x sepia-cpan-install <RET> MODULE <RET>'
686      Install MODULE and its prerequisites.  This feature is not yet
687      well tested.
690 \x1f
691 File: Sepia.info,  Node: Customization,  Next: Internals,  Prev: CPAN browsing,  Up: Top
693 5 Customization
694 ***************
696 While Sepia can be customized in both the Perl and Emacs Lisp, most of
697 the user-accessible configuration is in the latter.
699 * Menu:
701 * Emacs Variables::
702 * Perl Variables::
704 \x1f
705 File: Sepia.info,  Node: Emacs Variables,  Next: Perl Variables,  Prev: Customization,  Up: Customization
707 5.1 Emacs Variables
708 ===================
710 Since Sepia tries where possible to reuse existing Emacs functionality,
711 its behavior should already be covered by existing customizations.  The
712 two variables most likely to need customization are
713 `sepia-program-name' and `sepia-perl5lib'.  General Sepia mode
714 configuration can be done with `sepia-mode-hook', while REPL-specific
715 configuration can be done with `sepia-repl-mode-hook'.
717 `sepia-complete-methods'
718      If non-`nil', `sepia-complete-symbol' will complete simple method
719      calls of the form `$x->' or `Module->'.  Since the former requires
720      evaluation of `$x', this can be disabled.  Default: `T'.
722 `sepia-eval-defun-include-decls'
723      If non-`nil', attempt to generate a declaration list for
724      `sepia-eval-defun'.  This is necessary when evaluating some code,
725      such as that calling functions without parentheses, because the
726      presence of declarations affects the parsing of barewords.
727      Default: `T'.
729 `sepia-indent-expand-abbrev'
730      If non-`nil', `sepia-indent-or-complete' will, if reindentation
731      does not change the current line, expand an abbreviation before
732      point rather than performing completion.  Only if no abbreviation
733      is found will it perform completion.  Default: `T'.
735 `sepia-module-list-function'
736      The function to view a tree of installed modules.  Default:
737      `w3m-find-file' if Emacs-w3m is installed, or
738      `browse-url-of-buffer' otherwise.
740 `sepia-perldoc-function'
741      The function called to view installed modules' documentation.
742      Default: `w3m-perldoc' if Emacs-w3m is installed, or
743      `cperl-perldoc' otherwise.
745 `sepia-perl5lib'
746      A list of directories to include in `PERL5LIB' when starting
747      interactive Perl.  Default: `nil'.
749 `sepia-prefix-key'
750      The prefix to use for for functions in `sepia-keymap'.  Default:
751      <M-.>.
753 `sepia-program-name'
754      The Perl program name for interactive Perl.  Default: "perl".
756 `sepia-use-completion'
757      If non-`nil', various Sepia functions will generate completion
758      candidates from interactive Perl when called interactively.  This
759      may be slow or undesirable in some situations.  Default: `T'.
761 `sepia-view-pod-function'
762      The function called to view the current buffer's documentation.
763      Default: `sepia-w3m-view-pod' if Emacs-w3m is available, or
764      `sepia-perldoc-buffer' otherwise.
767 \x1f
768 File: Sepia.info,  Node: Perl Variables,  Prev: Emacs Variables,  Up: Customization
770 5.2 Perl Variables
771 ==================
773 When Sepia starts up, it evaluates the Perl script in `~/.sepiarc'.
775    The following variables in the Sepia package control various aspects
776 of interactive evaluation.
778 `$PACKAGE'
779      The package in which user input is evaluated, determined
780      automatically when code is evaluated from a buffer.  Default:
781      `main'.
783 `$PRINTER'
784      The function called to format interactive output, normally set
785      with the `printer' shortcut.
787 `$COLUMNATE'
788      If true, columnate simple arrays independent of the value of
789      `$PRINTER'.  Default: true.
791 `$STRINGIFY'
792      If true, stringify objects that overload the operation independent
793      of the value of `$PRINTER'.  Default: true.
795 `$PS1'
796      The trailing end of the prompt string, which should end with "> ".
797      Default: `"> "'.
799 `$STOPDIE'
800      If true, calls to `die' from interactive code will invoke the Sepia
801      debugger.  Default: true.
803 `$STOPWARN'
804      If true, calls to `warn' from interactive code will invoke the
805      Sepia debugger.  Default: false.
807 `$WANTARRAY'
808      If `@', evaluate interactive expressions in list context, if `$',
809      scalar, otherwise, void.  Default: `@'.
812    Additional REPL shortcuts can be defined with
813 `Sepia::define_shortcut'.  For example
815      Sepia::define_shortcut time => sub { print scalar localtime, "\n" },
816          'time', 'Display the current time.';
818    defines a shortcut "time" that displays the current time.  For
819 details, see the code in `Sepia.pm'.
821 \x1f
822 File: Sepia.info,  Node: Internals,  Next: FAQ,  Prev: Customization,  Up: Top
824 6 Internals
825 ***********
827 Many things remain unexplained except by the code itself, and some
828 details mentioned above should probably be given less prominence.  For
829 developer documentation, please see the POD for `Sepia' and
830 `Sepia::Xref', and the doc-strings in `sepia.el'.
832 \x1f
833 File: Sepia.info,  Node: FAQ,  Next: Credits,  Prev: Internals,  Up: Top
835 7 FAQ
836 *****
838 Can I use `Sepia' outside of Emacs?
839      Sepia comes with the `sepl' program, a command-line REPL using the
840      `Sepia::Readline' module, that provides many features of the
841      Emacs-based REPL.  It could be improved, though - patches welcome!
843 Why is the documentation in TeXInfo format?!
844      TeXInfo is the worst form of documentation, except for all the
845      others.  TeX and LaTeX produce beautiful printed output, and Info
846      is the best way to view documentation in Emacs for things that are
847      not themselves part of Emacs (i.e. "can have docstrings").
849      It's awful to edit, being both verbose and redundant - just look at
850      AUCTeX's `texinfo-every-node-update' for desperate placation of the
851      suck, then try to figure out what's wrong when `makeinfo' complains
852      about `texinfo-every-node-update''s output - but it's what we
853      have.  At least it sucks less than `DocBook', raw HTML, or `troff'.
856 \x1f
857 File: Sepia.info,  Node: Credits,  Next: Function Index,  Prev: FAQ,  Up: Top
859 Credits
860 *******
862 Hilko Bengen
863      Found and motivated me to fix a bunch of bugs, created Debian
864      packages.
866 Ævar Arnfjörð Bjarmason
867      Miscellaneous fixes.  Tested unicode support.
869 Ye Wenbin
870      Found and fixed numerous bugs.
872 Free Software
873      Portions of the code were lifted from Emacs-w3m, SLIME, ido, and
874      B::Xref, all of which are Free software.
877 \x1f
878 File: Sepia.info,  Node: Function Index,  Next: Variable Index,  Prev: Credits,  Up: Top
880 Function Index
881 **************
883 \0\b[index\0\b]
884 * Menu:
886 * sepia-apropos:                         Navigation.           (line 60)
887 * sepia-apropos-module:                  Navigation.           (line 63)
888 * sepia-callees:                         Navigation.           (line 73)
889 * sepia-callers:                         Navigation.           (line 69)
890 * sepia-complete-symbol:                 Completion.           (line 38)
891 * sepia-cpan-desc:                       CPAN browsing.        (line 17)
892 * sepia-cpan-doc:                        CPAN browsing.        (line 29)
893 * sepia-cpan-install:                    CPAN browsing.        (line 33)
894 * sepia-cpan-list:                       CPAN browsing.        (line 21)
895 * sepia-cpan-readme:                     CPAN browsing.        (line 25)
896 * sepia-cpan-search:                     CPAN browsing.        (line 13)
897 * sepia-defs:                            Navigation.           (line 52)
898 * sepia-dwim:                            Navigation.           (line 20)
899 * sepia-eval-defun:                      Evaluation.           (line 12)
900 * sepia-eval-expression:                 Evaluation.           (line 23)
901 * sepia-indent-or-complete:              Completion.           (line 43)
902 * sepia-install-eldoc:                   Documentation.        (line 29)
903 * sepia-jump-to-symbol:                  Navigation.           (line 36)
904 * sepia-load-file:                       Evaluation.           (line 17)
905 * sepia-location:                        Navigation.           (line 29)
906 * sepia-mode:                            Editing.              (line  6)
907 * sepia-module-find:                     Navigation.           (line 56)
908 * sepia-module-list:                     Documentation.        (line 25)
909 * sepia-next:                            Navigation.           (line 90)
910 * sepia-package-list:                    Documentation.        (line 19)
911 * sepia-perl-ne-region:                  Mutilation.           (line 17)
912 * sepia-perl-pe-region:                  Mutilation.           (line 12)
913 * sepia-perldoc-this:                    Documentation.        (line 12)
914 * sepia-perlize-region:                  Mutilation.           (line 20)
915 * sepia-rebuild:                         Navigation.           (line 94)
916 * sepia-rename-lexical:                  Other commands.       (line  7)
917 * sepia-repl:                            Interactive Perl.     (line  6)
918 * sepia-scratch:                         Scratchpad.           (line  6)
919 * sepia-set-cwd:                         Evaluation.           (line 28)
920 * sepia-var-defs:                        Navigation.           (line 81)
921 * sepia-var-uses:                        Navigation.           (line 77)
922 * sepia-view-pod:                        Documentation.        (line 16)
924 \x1f
925 File: Sepia.info,  Node: Variable Index,  Prev: Function Index,  Up: Top
927 Variable Index
928 **************
930 \0\b[index\0\b]
931 * Menu:
933 * sepia-complete-methods:                Emacs Variables.      (line 13)
934 * sepia-eval-defun-include-decls:        Emacs Variables.      (line 18)
935 * sepia-indent-expand-abbrev:            Emacs Variables.      (line 25)
936 * sepia-module-list-function:            Emacs Variables.      (line 31)
937 * sepia-perl5lib:                        Emacs Variables.      (line 41)
938 * sepia-perldoc-function:                Emacs Variables.      (line 36)
939 * sepia-prefix-key:                      Emacs Variables.      (line 45)
940 * sepia-program-name:                    Emacs Variables.      (line 49)
941 * sepia-use-completion:                  Emacs Variables.      (line 52)
942 * sepia-view-pod-function:               Emacs Variables.      (line 57)
945 \x1f
946 Tag Table:
947 Node: Top\x7f331
948 Node: Introduction\x7f701
949 Node: Getting Started\x7f1139
950 Node: Philosophy\x7f1764
951 Ref: Philosophy-Footnote-1\x7f4830
952 Node: Related Work\x7f5064
953 Node: Editing\x7f6230
954 Node: Completion\x7f6711
955 Node: Navigation\x7f8788
956 Node: Documentation\x7f12346
957 Node: Other commands\x7f13916
958 Node: Interactive Perl\x7f14251
959 Node: Shortcuts\x7f15147
960 Node: Debugger\x7f19004
961 Node: Evaluation\x7f20548
962 Node: Mutilation\x7f21524
963 Node: Scratchpad\x7f22476
964 Node: CPAN browsing\x7f22881
965 Node: Customization\x7f23875
966 Node: Emacs Variables\x7f24173
967 Node: Perl Variables\x7f26668
968 Node: Internals\x7f28261
969 Node: FAQ\x7f28617
970 Node: Credits\x7f29635
971 Node: Function Index\x7f30087
972 Node: Variable Index\x7f32933
973 \x1f
974 End Tag Table