Next: , Previous: Editing, Up: Editing


2.1 Completion

Sepia implements fairly sophisticated partial-word completion in collaboration with the inferior Perl process. For example, `%S:X:v_u' completes to `%Sepia::Xref::var_use' when Sepia is loaded. This completion only operates on functions and global variables known to the Perl interpreter, so it works best when code and interpreter are in sync.

More precisely, completion examines the text before point and tries each of the following in turn, using the first successful approach:

  1. If the text looks like a method call (e.g. `$object->f' or `Class->f'), complete on methods.
  2. If it looks like a variable, complete on variables; otherwise, complete on modules and functions.
  3. Otherwise, try to complete a Perl built-in operator.

For each of the first two, completions candidates are first generated by splitting the text on characters [:_] and matching the resulting word parts. For example, `X:a_b' will complete to all symbols matching `^X[^:]*:a[^:_]*_b' such as `Xref::a_bug' and `X::always_bites_me'. If no matches result, the text is treated as an acronym. For example, `dry' will complete to `dont_repeat_yourself'.

M-x sepia-complete-symbol
Complete the symbol before point as either a module, function, methd, or global variable. Note that this does not consider lexical scope, and is always case-sensitive, independent of completion-ignore-case.
TAB
M-x sepia-indent-or-complete
First try to indent the current line. If the indentation does not change, then try to expand an abbrev at point (unless sepia-indent-expand-abbrev is NIL). If no abbrev is expanded, then call sepia-complete-symbol.