Erlang Mailing Lists

Author Message

<  Erlang  ~  Newbie: distel erl-complete

Long John Silver
Posted: Sun Jul 13, 2008 2:44 pm Reply with quote
Joined: 29 Jan 2008 Posts: 5 Location: Monza - Italy
Hello all!
I'm new to the forum, new to erlang. I want to learn to make some simple programs and decided to start with erlang.
I am reading Armstrong book and I am facing my first problems.

I use distel with emacs on my linux box which seems to be quite a standard choice but the main function I suppose to use of distel "erl-complete" does not work. No errors or other messages, simply nothing.
Maybe some wrong setup of emacs.
Here below is my setup taken somewhere in the web:

Code:
;; This is needed for Erlang mode setup
(setq erlang-root-dir "/usr/lib64/erlang")
(setq load-path (cons "/usr/lib64/erlang/lib/tools-2.6/emacs" load-path))
(setq exec-path (cons "/usr//lib64/erlang/bin"  exec-path))
(require 'erlang-start)

;; This is needed for Distel setup
(let ((distel-dir "/usr/share/distel/ebin"))
  (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)))))


Thanks in advance for your help
LJS
View user's profile Send private message
michal
Posted: Tue Jul 15, 2008 7:17 am Reply with quote
User Joined: 20 Jul 2006 Posts: 44 Location: London
Hi,
I use distel with wrangler (refactoring tool for Erlang) downloaded from http://www.cs.kent.ac.uk/projects/forse/ Installation procedure says you need to add the following to your ~/.emacs file:
Code:

(add-to-list 'load-path "/home/michal/dev/distel-wrangler-0.3/elisp")
(require 'distel)
(distel-setup)

and following to your ~/.erlang file:
Code:

code:add_pathz("/home/michal/dev/distel-wrangler-0.3/ebin").


Then you also need to start erlang node with short name, let's say: erl -sname emacs, and the first time you will try to use any of the distel features like M-? for listing available module functions, distel will ask you for the host name. Give it emacs@nameofyourhost.

If the above works, start extending your .emacs file with other hooks and features found in the web.

/Michal

_________________
http://www.erlang-consulting.com
View user's profile Send private message
Long John Silver
Posted: Sat Jul 26, 2008 12:22 pm Reply with quote
Joined: 29 Jan 2008 Posts: 5 Location: Monza - Italy
I use Gentoo and cannot find a wrangler ebuild. While distel is available in Gentoo repository.
Anyway I do not see anything wrong in my setup. It is similar to the one you posted. Any other idea?

LJS
View user's profile Send private message
Long John Silver
Posted: Thu Aug 07, 2008 9:46 am Reply with quote
Joined: 29 Jan 2008 Posts: 5 Location: Monza - Italy
OK maybe I found the problem.
It seems that the distel is not connected to any node or it cannot connetc.
How can I check this?

LJS
View user's profile Send private message
Mazen
Posted: Thu Aug 07, 2008 9:51 am Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
nodes(). in the shell gives you a list of nodes it is connected to, it will be empty if it is not connected to anything (needless to say Smile)

use net_kernel:connect(Nodename). to connect to the other node. If that doesn't work (it will return true/false) then check the cookie of the node and make sure it is the same.
View user's profile Send private message
Long John Silver
Posted: Thu Aug 07, 2008 8:05 pm Reply with quote
Joined: 29 Jan 2008 Posts: 5 Location: Monza - Italy
I started an elang shell from a terminal with
Code:
erl -sname emacs

Then I started a shell in emacs and tried to connect to the node above:
[code]3> net_kernel:connect(emacs).
false.[code]

Why?
What's the problem?

Cookies should be set by the file .erlang.cookie in my /home
LJS[/code]
View user's profile Send private message
Mazen
Posted: Fri Aug 08, 2008 8:39 am Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
your emacs node's nodename is probably not emacs... it's emacs@something...

try net_kernel:connect('emacs@something')

also, when trouble shooting, explicitly check that the cookies are the same.
View user's profile Send private message
Long John Silver
Posted: Fri Aug 08, 2008 9:22 am Reply with quote
Joined: 29 Jan 2008 Posts: 5 Location: Monza - Italy
Now I cannot try but yesterday night I made some test.
From an erlang shell in emacs:
Code:
>node().
>nonode@nohost

or something similar.

I tried to open the shell after having activated the erlang-mode (in this case -sname is set to emacs) but I get an error.

Maybe the problem is the firewall (iptables)?
Is it possible?

LJS
View user's profile Send private message
wuji
Posted: Mon Aug 27, 2012 6:52 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
manager of the Golden Lamb, the historic restaurant and inn inn cheap authentic jordans inn in Lebanon, Ohio, which has been owned by Portman's
since 1926 — and where Portman usually orders the duck duck cheap designer *beep* duck breast and the lingonberry jus. "I think he would
tremendous at whatever he does."People in Ohio who have grown grown [h2]cheap Ralph Lauren[/h2] grown to know Portman well say that even if he
to become vice president, he wouldn't abandon his roots in in [h2]cheap Ralph Lauren[/h2] in the swing state from which he hails.Portman has forged
relationship with the parents of Matt Maupin, an Army sergeant sergeant cheap polo shirts sergeant from Ohio who was captured in Iraq in 2004,
later killed by insurgents. While Maupin was missing, Portman set set real jordans set up a meeting between President Bush and Maupin's parents,
a
View user's profile Send private message
landy54321
Posted: Wed Aug 29, 2012 2:53 am Reply with quote
Joined: 29 Aug 2012 Posts: 1
Tout le monde witout ombre d'un doute longchamp outlet à la maison avec nike air max pas cher un agriculteur dans un point , si le mec difficile , bien dans le courant national Basketball Association point Stratégie a incroyablement inexpliquée complètement inconnu.
This particular longchamp shop online occurs in Bosh body. air max pas cher Raptors, Bosh is out Renzhong Feng air max tn way of deal with any significant protective force, keep in mind in excess of this game enthusiasts each night, along with potential fight, and also appears to be do not be in the position to avoid that he's no "pure" heart connected with shackles.
View user's profile Send private message
dongdongwu
Posted: Thu Sep 20, 2012 2:09 am Reply with quote
User Joined: 19 Sep 2012 Posts: 236
His good friend Diane said: "Christian Louboutin Men Shoes was a magician, he make shoes is immediately put his female people with legs and advantage. He understands women wanted to do and can make them into beautiful Cinderella." Madonna often in its concert wearing Christian louboutin high heels , and some famous superstar like Angelina jolie, mariah Carey, beyonce Knowles, the famous Japanese singer YaYouMei Hamasaki helps Christian Louboutin Men Shoes set up its powerful position. The youngest customers will count Tom cruise's daughter sully cruz. Louboutin made for only a pair of handmade Christian Louboutin high heel Shoes! Want to be more fashion? Put on Christian Louboutin Outlet !
Candy colors of the chalaza high-heeled shoes with lolita type allure, set full finely gem blue "neon shoes" is to need to use "sexy" to describe. Each pair are worth careful appreciation of lithe and graceful fairy ludaoli, what kind of most let you move?Christian Louboutin Men Shoes that one brush red is always cannot resist the temptation, Christian Louboutin men outlet continue to use the days of high 8cm above slender heel proclaim the sexy and luxuriant. The bowknot on black pointed high-heeled shoes with sharp rivet concomitant, wild python met enchanting color printing grain, It is that pairs of high-heeled shoes lets Carrie more feminine flavour. Like Christian Louboutin for men her word.
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum