factor/misc/fuel
Slava Pestov 0432b00336 Merge branch 'emacs' of http://git.hacks-galore.org/jao/factor 2009-04-30 21:16:37 -05:00
..
README FUEL: New refactoring command: fuel-refactor-make-generic. 2009-02-20 01:02:24 +01:00
factor-mode.el FUEL: C-uC-co won't ask for file creation while cycling. 2009-02-22 20:20:46 +01:00
fu.el FUEL: Autoloads for customization groups. 2009-02-28 02:56:38 +01:00
fuel-autodoc.el FUEL: Don't load vocabs in USING: form by default. 2009-02-19 01:33:47 +01:00
fuel-base.el FUEL: Fix usings update when no newline at eof. 2009-01-12 02:34:39 +01:00
fuel-completion.el FUEL: Small nits. 2009-02-05 10:45:44 +01:00
fuel-connection.el FUEL: modify directly use/in to set up evaluation context 2009-04-19 20:35:54 +02:00
fuel-debug-uses.el Make fuel auto-use the existing using in fuel-debug--uses-for-file. 2009-04-15 16:12:31 -07:00
fuel-debug.el FUEL: small fix. 2009-01-21 03:22:37 +01:00
fuel-edit.el FUEL: Recognised parenthesised forms (e.g., stack effects) as syntactic constructs. 2009-02-14 13:44:12 +01:00
fuel-eval.el FUEL: Don't load vocabs in USING: form by default. 2009-02-19 01:33:47 +01:00
fuel-font-lock.el FUEL: Fixes for POSTPONE: forms font-lock. 2009-04-15 08:13:56 +02:00
fuel-help.el FUEL: Accept '?' in prompts for word and vocabs. 2009-02-05 10:28:57 +01:00
fuel-listener.el FUEL: Persistent listener history. 2009-02-28 02:29:35 +01:00
fuel-log.el FUEL: Initial word completion (M-TAB) plus lotsa fixes. 2008-12-15 23:44:13 +01:00
fuel-markup.el FUEL: fix vocabulary list tables. 2009-03-07 14:21:23 +01:00
fuel-mode.el FUEL: Fix for C-cC-eC-l (make factor command ( -- )). 2009-04-24 22:15:20 +02:00
fuel-popup.el FUEL: New fuel-update-usings (C-cC-eu) command. 2008-12-23 22:37:25 +01:00
fuel-refactor.el FUEL: More robust extract word refactoring (catching empty region case). 2009-04-04 22:34:21 +02:00
fuel-scaffold.el FUEL: Accept '?' in prompts for word and vocabs. 2009-02-05 10:28:57 +01:00
fuel-stack.el FUEL: Customization docstrings homogenized. 2008-12-22 01:51:41 +01:00
fuel-syntax.el FUEL: Fixes for string highlighting. 2009-04-24 22:03:38 +02:00
fuel-table.el FUEL: Shorten very long words in tables to keep delims aligned. 2009-01-07 02:47:44 +01:00
fuel-xref.el FUEL: Accept '?' in prompts for word and vocabs. 2009-02-05 10:28:57 +01:00

README

FUEL, Factor's Ultimate Emacs Library
-------------------------------------

FUEL provides a complete environment for your Factor coding pleasure
inside Emacs, including source code edition and interaction with a
Factor listener instance running within Emacs.

FUEL was started by Jose A Ortega as an extension to Eduardo Cavazos'
original factor.el code. Eduardo is also responsible of naming the
beast.

* Installation

  FUEL comes bundled with Factor's distribution. The folder misc/fuel
  contains Elisp code, and there's a fuel vocabulary in extras/fuel.

  To install FUEL, either add this line to your Emacs initialisation:

  (load-file "<path/to/factor/installation>/misc/fuel/fu.el")

  If all you want is a major mode for editing Factor code with pretty
  font colors and indentation, without running the factor listener
  inside Emacs, you can use instead:

  (add-to-list 'load-path "<path/to/factor/installation>/fuel")
  (setq factor-mode-use-fuel nil)
  (require 'factor-mode)

* Basic usage
*** Running the listener

    If you're using the default factor binary and images locations inside
    the Factor's source tree, that should be enough to start using FUEL.
    Editing any file with the extension .factor will put you in
    factor-mode; try C-hm for a summary of available commands.

    To start the listener, try M-x run-factor.

    By default, FUEL will try to use the binary and image files in the
    factor installation directory. You can customize them with:

    (setq fuel-listener-factor-binary <full path to factor>)
    (setq fuel-listener-factor-image <full path to factor image>)

    Many aspects of the environment can be customized:
    M-x customize-group fuel will show you how many.

*** Faster listener startup

    On startup, run-factor loads the fuel vocabulary, which can take a
    while. If you want to speedup the load process, type 'save' in the
    listener prompt just after invoking run-factor. This will save a
    factor image (overwriting the current one) with all the needed
    vocabs.

    Alternatively, you can add the following line to your
    .factor-boot-rc file:

       "fuel" require

    This will ensure that the image generated while bootstrapping
    Factor contains fuel and the vocabularies it depends on.

*** Connecting to a running Factor

    'run-factor' starts a new factor listener process managed by Emacs.
    If you prefer to start Factor externally, you can also connect
    remotely from Emacs. Here's how to proceed:

    - In the factor listener, run FUEL: "fuel" run
      This will start a server listener in port 9000.
    - Switch to Emacs and issue the command 'M-x connect-to-factor'.

  That's it; you should be up and running. See the help for
  'connect-to-factor' for how to use a different port.

*** Vocabulary creation

    FUEL offers a basic interface to Factor's scaffolding utilities.
    To create a new vocabulary directory and associated files:

       M-x fuel-scaffold-vocab

    and when in a vocab file, to create a docs file with boilerplate
    for each word:

       M-x fuel-scaffold-help

* Quick key reference

  Triple chords ending in a single letter <x> accept also C-<x> (e.g.
  C-cC-eC-r is the same as C-cC-er).

*** In factor source files:

    Commands in parenthesis can be invoked interactively with
    M-x <command>, not necessarily in a factor buffer.

    |-----------------+------------------------------------------------------------|
    | C-cz            | switch to listener (run-factor)                            |
    | C-co            | cycle between code, tests and docs files                   |
    | C-cr            | switch to listener and refresh all loaded vocabs           |
    | C-cs            | switch to other factor buffer (fuel-switch-to-buffer)      |
    | C-x4s           | switch to other factor buffer in other window              |
    | C-x5s           | switch to other factor buffer in other frame               |
    |-----------------+------------------------------------------------------------|
    | M-.             | edit word at point in Emacs (fuel-edit-word)               |
    | M-,             | go back to where M-. was last invoked                      |
    | M-TAB           | complete word at point                                     |
    | C-cC-eu         | update USING: line (fuel-update-usings)                    |
    | C-cC-ev         | edit vocabulary (fuel-edit-vocabulary)                     |
    | C-cC-ew         | edit word (fuel-edit-word-at-point)                        |
    | C-cC-ed         | edit word's doc (C-u M-x fuel-edit-word-doc-at-point)      |
    | C-cC-el         | load vocabs in USING: form                                 |
    |-----------------+------------------------------------------------------------|
    | C-cC-er         | eval region                                                |
    | C-M-r, C-cC-ee  | eval region, extending it to definition boundaries         |
    | C-M-x, C-cC-ex  | eval definition around point                               |
    | C-ck, C-cC-ek   | run file (fuel-run-file)                                   |
    |-----------------+------------------------------------------------------------|
    | C-cC-da         | toggle autodoc mode (fuel-autodoc-mode)                    |
    | C-cC-dd         | help for word at point (fuel-help)                         |
    | C-cC-ds         | short help word at point (fuel-help-short)                 |
    | C-cC-de         | show stack effect of current sexp (with prefix, region)    |
    | C-cC-dp         | find words containing given substring (fuel-apropos)       |
    | C-cC-dv         | show words in current file (with prefix, ask for vocab)    |
    |-----------------+------------------------------------------------------------|
    | C-cM-<, C-cC-d< | show callers of word or vocabulary at point                |
    |                 | (fuel-show-callers, fuel-vocab-usage)                      |
    | C-cM->, C-cC-d> | show callees of word or vocabulary at point                |
    |                 | (fuel-show-callees, fuel-vocab-uses)                       |
    |-----------------+------------------------------------------------------------|
    | C-cC-xs         | extract innermost sexp (up to point) as a separate word    |
    |                 | (fuel-refactor-extract-sexp)                               |
    | C-cC-xr         | extract region as a separate word                          |
    |                 | (fuel-refactor-extract-region)                             |
    | C-cC-xv         | extract region as a separate vocabulary                    |
    |                 | (fuel-refactor-extract-vocab)                              |
    | C-cC-xi         | replace word by its definition (fuel-refactor-inline-word) |
    | C-cC-xw         | rename all uses of a word (fuel-refactor-rename-word)      |
    | C-cC-xa         | extract region as a separate ARTICLE: form                 |
    | C-cC-xg         | convert current word definition into GENERIC + method      |
    |                 | (fuel-refactor-make-generic)                               |
    |-----------------+------------------------------------------------------------|

*** In the listener:

    |------+----------------------------------------------------------|
    | TAB  | complete word at point                                   |
    | M-.  | edit word at point in Emacs                              |
    | C-cr | refresh all loaded vocabs                                |
    | C-ca | toggle autodoc mode                                      |
    | C-cp | find words containing given substring (M-x fuel-apropos) |
    | C-cs | toggle stack mode                                        |
    | C-cv | edit vocabulary                                          |
    | C-ch | help for word at point                                   |
    | C-ck | run file                                                 |
    |------+----------------------------------------------------------|

*** In the debugger (it pops up upon eval/compilation errors):

    |---------+-------------------------------------|
    | g       | go to error                         |
    | <digit> | invoke nth restart                  |
    | w/e/l   | invoke :warnings, :errors, :linkage |
    | q       | bury buffer                         |
    |---------+-------------------------------------|

*** In the help browser:

    |-----------+----------------------------------------------------------|
    | h         | help for word at point                                   |
    | v         | help for a vocabulary                                    |
    | a         | find words containing given substring (M-x fuel-apropos) |
    | e         | edit current article                                     |
    | ba        | bookmark current page                                    |
    | bb        | display bookmarks                                        |
    | bd        | delete bookmark at point                                 |
    | n/p       | next/previous page                                       |
    | l         | previous page                                            |
    | SPC/S-SPC | scroll up/down                                           |
    | TAB/S-TAB | next/previous link                                       |
    | k         | kill current page and go to previous or next             |
    | r         | refresh page                                             |
    | c         | clean browsing history                                   |
    | M-.       | edit word at point in Emacs                              |
    | C-cz      | switch to listener                                       |
    | q         | bury buffer                                              |
    |-----------+----------------------------------------------------------|

*** In crossref buffers

    |-----------------+-----------------------------|
    | TAB/BACKTAB     | navigate links              |
    | RET/mouse click | follow link                 |
    | h               | show help for word at point |
    | q               | bury buffer                 |
    |-----------------+-----------------------------|