Ngoc Dao wrote:
> After many try-and-errors I suspect that Distel currently can only
> interpret a module if its .beam file is in the same directory with its
> .erl file, or in ../ebin. Is this true? How to overcome this problem?
>>Maybe add_path will help you.
@spec code:add_patha(Dir) => true | {error, bad_directory}
And you can check this by code:get_path().
> On Sat, Sep 12, 2009 at 1:09 AM, Eric Liang <> wrote:
>>> Eric Liang wrote:
>>>> Ngoc Dao wrote:
>>>> I tried Distel from trunk yesterday and it did not work. The version
>> from download did work:
>>http://code.google.com/p/distel/downloads/list.>>>>>>>> Thanks Ngoc, it works. But, still can't debug and profile, like Bill
>> Clementson's introduction.
>>>> When I type C-c C-d i, it looks like is interpreting forever, and can't set
>> breakpoints to debug. I've checked the archive of this mailling list, there
>> is only one unresolved thread here:
>>>>http://groups.google.com/group/erlang-programming/browse_thread/thread/c34d5245998948c6>>>> Do you have more suggestions? TIA.
>>>> I think I've resolved this. Just load module (C-c C-d L) before being
>> interpreted. So simple. :-[
>>>> In Distel, load module will tell you nothing more than "load: [module
>> test_ring]", except the first time is successful, in which scenario, it will
>> tell you "Successfully uploaded backend modules into node". So, It's
>> difficulty to know whether or not the module was loaded successfully.
>>>> And, one module can be loaded only if it's beam has been compiled by the
>> flag: debug_info.
>>>>>> On Thu, Sep 10, 2009 at 6:46 PM, Eric Liang <> wrote:
>>>>>> Hi all,
>> To build a erlang IDE, I've tried Distel in emacs22. but unfortunately it
>> does not work well. What I've done is exactly in accordance with Bill
>> Clementson's blog post:
>>>>http://bc.tech.coop/blog/070528.html>>>> They are:
>>>> Download the latest code from : http://distel.googlecode.com/svn/trunk/>> Modify the .emacs. I did confirm the load-path and distel-dir settings are
>> correct. Here is it:
>>>> ;; 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)
>>>> ;; 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)))))
>>>> 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:
>>>> Unexpected reply: [rex [badrpc [EXIT [undef ([distel rpc_entry (distel
>> modules ("cr"))] [rpc -handle_call/3-fun-0- 5])]]]]
>>>> 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:
>>>> *** ERROR: Shell process terminated! ***
>>>> =ERROR REPORT==== 8-Sep-2009::15:02:42 ===
>> Error in process <0.66.0> on node '' 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..
>>>> 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?
>>>> As a newbie in Erlang, it's very possible I've stepped in the wrong
>> way.However, any suggestions will be appreciated.
>>>> Thanks in advance.
>>>> Eric
>>>>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090914/70b15c65/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090914/70b15c65/attachment.bin>