<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi all,<br>
To build a erlang IDE, I've tried Distel in emacs22. but unfortunately
it does not work well.
What I've done is <span>exactly in accordance with </span>Bill
Clementson's blog post:<br>
<blockquote><a class="moz-txt-link-freetext"
href="http://bc.tech.coop/blog/070528.html">http://bc.tech.coop/blog/070528.html</a>
<br>
</blockquote>
They are:<br>
<ol>
<li>Download the latest code from : <a class="moz-txt-link-freetext"
href="http://distel.googlecode.com/svn/trunk/">http://distel.googlecode.com/svn/trunk/</a></li>
<li>Modify the .emacs. I did confirm the load-path and distel-dir
settings are correct. Here is it:<br>
<blockquote><span class="rss:item">
<pre>;; This is needed for Erlang mode setup
(setq erlang-root-dir "/usr/local/lib/erlang")
(setq load-path (cons "/usr/local/lib/erlang/lib/tools-2.5.1/emacs" load-path))
(setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path))
(require 'erlang-start)
;; This is needed for Distel setup
(let ((distel-dir "/Users/bc/Projects/distel/elisp"))
(unless (member distel-dir load-path)
;; Add distel-dir to the end of load-path
(setq load-path (append load-path (list distel-dir)))))
(require 'distel)
(distel-setup)
<span class="rss:item"><pre>;; Some Erlang customizations
(add-hook 'erlang-mode-hook
(lambda ()
;; when starting an Erlang shell in Emacs, default in the node name
(setq inferior-erlang-machine-options '("-sname" "emacs"))
;; add Erlang functions to an imenu menu
(imenu-add-to-menubar "imenu")))
;; A number of the erlang-extended-mode key bindings are useful in the shell too
(defconst distel-shell-keys
'(("\C-\M-i" erl-complete)
("\M-?" erl-complete)
("\M-." erl-find-source-under-point)
("\M-," erl-find-source-unwind)
("\M-*" erl-find-source-unwind)
)
"Additional keys to bind when in Erlang shell.")
(add-hook 'erlang-shell-mode-hook
(lambda ()
;; add some Distel bindings to the Erlang shell
(dolist (spec distel-shell-keys)
(define-key erlang-shell-mode-map (car spec) (cadr spec)))))</pre></span></pre>
</span></blockquote>
</li>
</ol>
When I open a .erl file, it works well and Distel dose exist in the
Erlang tag of the emacs' menubar. But when I type C-M-i behind the word
"cr" to complete the function name,the emacs received this message:<br>
<blockquote>Unexpected reply: [rex [badrpc [EXIT [undef ([distel
rpc_entry (distel modules ("cr"))] [rpc -handle_call/3-fun-0- 5])]]]]<br>
</blockquote>
I checked the code in Distel, it looks like that it will call
completions() which will call the get() by the argument:A an empty
string("") in otp_doc.erl. The function get() will call to_list() on
the argument:A,which will get the error:<br>
<blockquote>*** ERROR: Shell process terminated! ***<br>
<br>
=ERROR REPORT==== 8-Sep-2009::15:02:42 ===<br>
Error in process <0.66.0> on node 'emacs@doubleclick' with exit
value:
{undef,[{lib,format_exception,[4,error,undef,[{erl_internal,bif,[to_list,1]},{erl_lint,expr,3},{erl_lint,exprs,3},{erl_lint,exprs_opt,3},{erl_eval,check_command,2},{shell,exprs,6},{shell,eval_exprs,6},{shell,eval_loop..<br>
</blockquote>
I guess this is the reason for the completion failure, but have no idea
how to fix it. Can anyone here give me some advice?<br>
<br>
As a newbie in Erlang, it's very possible I've stepped in the wrong
way.However, any suggestions will be appreciated. <br>
<br>
Thanks in advance.<br>
<br>
Eric
</body>
</html>