Erlang man pages in Emacs
Ruslan Spivak - - August 19, 2007Well it’s actually as simple as running M-x man RET module_name RET in minibuffer.
I’m using Erlang setup from rpm on FC7 and by default man pages are located under /usr/lib/erlang/man/ so to use above command in minibuffer you must make sure you have your erlang’s man path either in /etc/man.config or you’ve added it into MANPATH with something like export MANPATH=$MANPATH:/usr/lib/erlang/man in your .bash_profile in case your Erlang man pages are not in location accessible by default.
You may also pass man path in minibuffer manually without changing /etc/man.config or MANPATH. In my case to view man page for ‘lists’ module it will look like:
M-x man RET -M /usr/lib/erlang/man lists RET
I’ve customized some stuff for myself in emacs and made binding to F6 key so that whenever i set cursor on module name in my erlang buffer and press F6 i get man page in another window poped up describing module at point. So if you have in your code or in any buffer, for example:
(em@localhost)2> lists:reverse([1, 2, 3]).
you need to move cursor to lists and press F6. Quite handy if you consult man pages often, which is the case for me now as i learn Erlang.
Here is the corresponding elisp helper function and key binding from my dot emacs:
(defun get-erl-man () (interactive) (let* ((man-path "/usr/lib/erlang/man") (man-args (format "-M %s %s" man-path (current-word)))) (man man-args))) (global-set-key [(f6)] (lambda () (interactive) (get-erl-man)))
Categories: Blogs Ruslan Spivak
Erlang on Twitter
» voluntas (V): winamp cloud は Erlang/OTP で出来てるのか ... 。さらに cowboy 使ってるとか素敵だ。
» tajgur (Martin Wiso): Yeah still at office. Fixing Erlang, Ruby, HTML… anything more? :-)
» anarchival (anarchival): Dr. Frank Brickle is ham radio op, an Erlang programmer, and a professional composer. This is his opera for puppets: http://t.co/c3JJgAFid5
» azizahDIT (AULIA AZIZAH ): @Des_Santosveiro duh idenya ce,erlang sekali :*
» TibidyUS (Tibidy): All about #Erlang. Tagged on http://t.co/eGC5FTsYS2
» tripping_ba11s (アニータ): 尊敬する師匠が何十回と読めと言っていた。 “Making reliable
distributed systems
in the presence of sodware errors http://t.co/62VQHQCnAh”
» seancribbs (Sean Cribbs): @reiddraper Will you be at the Erlang meetup tomorrow?
» stevevinoski (Steve Vinoski): heading to Erlang Factory Lite Dublin #ErlangFactory #erlang
» jimitndiaye (Jimit Ndiaye): RT @ToJans: “Any sufficiently complicated concurrent program contains an ad hoc informally-specified bug-ridden slow implementation of half…
» introspection (Guillaume Dumas): Faster than GPU: Now you can use Quantum Computing with… #Numpy! What about Erlang? :D http://t.co/h8U5HMZWHy #RIPRSA c/@mdu4rt3
Statistics
Number of aggregated posts: 10650
Most recent article: May 20, 2013
Latest comments
» Moraru on This is Why You Spent All that Time Learning to Program: It is true that computer science was a pain in the back at time that i’ve had to learn it…
» Commercial hand dryers on Couchbase Meetup at new HQ: Buy online from here where you will get so much of variety in Commercial hand dryers for people. If you…
» Fort McMurray Homes on Motivated Reasoning and Erlang vs Python vs Node: I don’t really understand why this post is motivational? I don’t even see a post, just a title. Fort McMurray…