-
Notifications
You must be signed in to change notification settings - Fork 45
/
INSTALL
100 lines (74 loc) · 4.42 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Installation
-------------
Requirements: In order to use Wrangler, you must first have working
installations of Erlang and Emacs (or XEmacs). If you use
Mac OS X 10.7 (Lion), you will need to use the flag
--enable-darwin-64bit in building Erlang.
Step 1) Build and optionally install the software in the usual way:
./configure && make && sudo make install
By default Wrangler is installed under the directory '/usr/local';
to install Wrangler in a different directory, you need to explicitly
specify the directory using the '--prefix=...' flag of 'configure'.)
As long as the Emacs Lisp source files are installed together with
the compiled BEAM files, then Wrangler should be able to
configure the code path automatically. Otherwise, you may need
to set the code path explicitly as follows.
If you do not install Wrangler as part of your existing Erlang
installation (the default location), then please make sure that
Erlang can find Wrangler in its code path. This can e.g. be done by
including a line like the following in your ~/.erlang file:
code:add_path("/path/to/wrangler/ebin").
(Don't forget to substitute the location of your Wrangler directory
for "/path/to/wrangler" above.)
Another way is to set the environment variable ERL_LIBS to the path
to a directory under which you keep one or more Erlang libraries.
E.g., if your Wrangler directory is ~/erlang/lib/wrangler, then
setting ERL_LIBS to ~/erlang/lib will make Erlang automatically add
~/erlang/lib/wrangler/ebin to the code path on startup.
Step 2) If you already have Erlang mode for Emacs installed, go to Step 3;
otherwise add the following lines to your ~/.emacs file (or
~/.xemacs/init.el for XEmacs):
(setq erlang-root-dir "/usr/local/lib/erlang")
(add-to-list 'exec-path "/usr/local/lib/erlang/bin")
(add-to-list 'load-path
"/usr/local/lib/erlang/lib/tools-<ToolsVer>/emacs")
(require 'erlang-start)
NOTE: you have to replace <ToolsVer> in the above with the correct
version number. Also, if Erlang/OTP is not installed in the
directory '/usr/local/lib/erlang' on your system, please substitute
the correct path.
Step 3) Add these lines to your ~/.emacs (or ./.xemacs/init.el for XEmacs):
(add-to-list 'load-path
"/usr/local/lib/erlang/lib/wrangler-<WranglerVer>/elisp")
(require 'wrangler)
replacing <WranglerVer> with the correct version number. If you
installed Wrangler in a different location (or did not run "make
install"), then please substitute the correct path for your system.
Step 4) Wrangler includes a version of Distel. If you have a more recent
version of Distel that you want to use instead, please make sure
that your version occurs before Wrangler *both* in the Emacs
load-path and in the Erlang code path. The latter can be done by
including a line like the following in your ~/.erlang file:
code:add_patha("/path/to/distel/ebin").
(note: 'add_patha', not 'add_path'!), replacing "/path/to/distel"
with the location of your preferred Distel installation.
There is no need to call "(require 'distel)" or "(distel-setup)" in
your .emacs if you call "(require 'wrangler)" - this is done
automatically, loading the Distel elisp files from the load-path
that you have set in your .emacs file. E.g.,:
(add-to-list 'load-path "/path/to/distel/elisp")
Make sure that this is called *after* the Wrangler directory is
added to the load-path (since add-to-list prepends new entries), but
*before* the call to "(require 'wrangler)".
Step 5) Some code inspection functionalities of Wrangler generate .dot
files, which can be compiled and previewed in Emacs if the
Graphviz-dot mode for Emacs is enabled. If you would like to enable
the Graphviz-dot mode, add the following line to your ~/.emacs file:
(load-library "graphviz-dot-mode")
Step 6) Wrangler requires an .erlang.cookie file in your $HOME directory,
please create one if it does not exist. An easy way of doing this is
to start Erlang once in distributed mode: e.g., `erl -sname foo',
which will generate a random string. Or you can choose your own
string for the cookie, e.g., `echo "foobar" > .erlang.cookie'.
You should now be able to use Wrangler. For problems and bug reports, please
send a note to 'hl@kent.ac.uk' or 'erlang-refactor@kent.ac.uk'.