| | 1 | = Basic usage in Emacs/XEmacs = |
| | 2 | |
| | 3 | The GNU Emacs and the XEmacs text editors are supported user interfaces. |
| | 4 | At least version 22 is required for Emacs and version 21 is required for XEmacs. |
| | 5 | |
| | 6 | Refactoring is performed by an Erlang server process, which stores analysed |
| | 7 | source files in a database. This server is started automatically by the (X)Emacs |
| | 8 | interface, and it should be stopped manually before leaving (X)Emacs. Only |
| | 9 | those files that are loaded into the database are subjects to refactoring. |
| | 10 | |
| | 11 | == Configuration in XEmacs/Emacs. == |
| | 12 | |
| | 13 | === Loading !RefactorErl.=== |
| | 14 | First of all, you need to load the !RefactorErl library |
| | 15 | into XEmacs or into Emacs. You can do this by placing the following two |
| | 16 | lines into your {{{.xemacs/init.el}}} le in the former or into your {{{.emacs}}} |
| | 17 | file in the latter case (you can copy&paste it from the |
| | 18 | {{{ README.TXT}}} file from the |
| | 19 | !RefactorErl package): |
| | 20 | |
| | 21 | {{{ |
| | 22 | (add-to-list 'load-path |
| | 23 | "/path-to-root-dir/lib/referl_ui/emacs") |
| | 24 | (require 'refactorerl) |
| | 25 | }}} |
| | 26 | |
| | 27 | If you don't know where your {{{.emacs}}} file is, the easiest way to locate it is |
| | 28 | to start Emacs and type {{{C-x C-f ~/.emacs}}} - this always opens the right file. |
| | 29 | Similar in XEmacs type {{{C-x C-f ~/.xemacs/init.el}}} |
| | 30 | |
| | 31 | If you don't know what {{{C-x C-f}}} is, then you should read the (X)Emacs |
| | 32 | tutorial to get more familiar with the environment - you can access it by starting |
| | 33 | (X)Emacs and pressing the keys {{{Ctrl+h}}}, and then {{{t}}}.[[BR]] |
| | 34 | |
| | 35 | |
| | 36 | === Basic settings. === |
| | 37 | |
| | 38 | Before you can run !RefactorErl, you must make some settings |
| | 39 | through the Emacs customization system. |
| | 40 | |
| | 41 | Type {{{M-x customize-group}}}, then enter {{{refactorerl}}} as the name of the group. |
| | 42 | Here you can change the following settings: |
| | 43 | |
| | 44 | * {{{Refactorerl Base Path}}}: you must enter the full path to the root directory of the tool. Strictly speaking, this is the only required customization, every other setting has a sensible default. |
| | 45 | |
| | 46 | * {{{Refactorerl Erlang Runtime}}}: if your {{{PATH}}} setting doesn't contain the Erlang commands, then you should enter the full path to the erl command here. |
| | 47 | |
| | 48 | * {{{Refactorerl Data Dir}}}: you can change the location of the database here. |
| | 49 | |
| | 50 | * {{{Refactorerl Server Type}}}: if you want to experiment with the command line interface of the tool, you should set this to "Managed server with shell access". This feature requires the standard Erlang editing mode. |
| | 51 | |
| | 52 | ... |
| | 53 | |