wiki:EmacsInterface

Version 1 (modified by manualwiki, 12 years ago) (diff)

--

Basic usage in Emacs/XEmacs

The GNU Emacs and the XEmacs text editors are supported user interfaces. At least version 22 is required for Emacs and version 21 is required for XEmacs.

Refactoring is performed by an Erlang server process, which stores analysed source files in a database. This server is started automatically by the (X)Emacs interface, and it should be stopped manually before leaving (X)Emacs. Only those files that are loaded into the database are subjects to refactoring.

Configuration in XEmacs/Emacs.

Loading RefactorErl.

First of all, you need to load the RefactorErl library into XEmacs or into Emacs. You can do this by placing the following two lines into your .xemacs/init.el le in the former or into your .emacs file in the latter case (you can copy&paste it from the README.TXT file from the RefactorErl package):

(add-to-list 'load-path
"/path-to-root-dir/lib/referl_ui/emacs")
(require 'refactorerl)

If you don't know where your .emacs file is, the easiest way to locate it is to start Emacs and type C-x C-f ~/.emacs - this always opens the right file. Similar in XEmacs type C-x C-f ~/.xemacs/init.el

If you don't know what C-x C-f is, then you should read the (X)Emacs tutorial to get more familiar with the environment - you can access it by starting (X)Emacs and pressing the keys Ctrl+h, and then t.

Basic settings.

Before you can run RefactorErl, you must make some settings through the Emacs customization system.

Type M-x customize-group, then enter refactorerl as the name of the group. Here you can change the following settings:

  • 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.
  • 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.
  • Refactorerl Data Dir: you can change the location of the database here.
  • 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.

...

Attachments (4)

Download all attachments as: .zip