Technitribe

interesting problems (and a few solutions, too)

Technitribe
  • About the Authors
  • Log In
  • Log Out
  • Lost Password
  • Register
  • Reset Password
    • 2 Dec 2009

      Macports, and Erlang: Setting up Emacs and your $MANPATH

      Written by Tim Bielawa

      You may find this helpful if you should find yourself using Erlang on OS X and you’ve installed it using Macports. After a default installation you’ll need to manually configure your .emacs file for erlang-mode and set your $MANPATH variable correctly, here’s how.

      If you’ve installed Erlang with Macports then you may have noticed that when you edit .erl files you’re not entering into erlang-mode, nor is it available to enter into. Here’s how I got erlang-mode working on my system.

      Macports will install Erlang into /opt/local/lib/erlang by default. The paths to put in your .emacs file provided in the erlang-mode documentation only need to be tweaked a slight bit to function properly. Here’s what I put in mine:

      (setq load-path (cons  "/opt/local/lib/erlang/lib/tools-2.6.4/emacs/" load-path))
      (setq erlang-root-dir "/opt/local/lib/erlang")
      (setq exec-path (cons "/opt/local/bin" exec-path))
      (require 'erlang-start)

      Note that you may require setting “tools-2.6.4” to something else if Macports has upgraded it’s distribution of Erlang.

      Setting up your $MANPATH variable is fairly simple as well. Just put the string “/opt/local/lib/erlang/man” in a file called ‘erlang’ in /etc/manpaths.d/ and make sure it ends with an empty line. Test this by opening a new terminal and running: echo $MANPATH | grep erlang. If it doesn’t come back empty then you’ve done it right.

      • Tags »
      • Erlang Macports Manpath

    4 Comment on “Macports, and Erlang: Setting up Emacs and your $MANPATH”

    • Bill Robertson

      03 Dec 2009 11:12 pm

      Having trouble with the man path. I think I did what you said.

      created the file, here it is…
      bills-macbook-pro:manpaths.d bill$ cd /etc/manpaths.d
      bills-macbook-pro:manpaths.d bill$ ls -al
      total 8
      drwxr-xr-x 4 root wheel 136 Dec 3 23:29 .
      drwxr-xr-x 94 root wheel 3196 Dec 3 20:56 ..
      -rw-r–r– 1 root wheel 19 Jul 11 02:29 X11
      -rw-r–r– 1 root wheel 26 Dec 3 23:27 erlang

      It contains the right value, and erlang’s man files are there…
      bills-macbook-pro:manpaths.d bill$ cat erlang
      /opt/local/lib/erlang/man
      bills-macbook-pro:manpaths.d bill$ ls /opt/local/lib/erlang/man/
      man1 man3 man4 man6

      The file ends with a blank line…
      bills-macbook-pro:manpaths.d bill$ od -c erlang
      0000000 / o p t / l o c a l / l i b / e
      0000020 r l a n g / m a n \n
      0000032

      No joy…
      bills-macbook-pro:manpaths.d bill$ echo $MANPATH
      /opt/local/share/man:

      Restarted terminal program, logged out, and just for kicks I rebooted the machine. No difference.

      Any suggestions?

    • tbielawa

      04 Dec 2009 04:12 am

      Bill,

      In /etc/ there’s another file, “profile”, which is executed each time a new shell is launched much like your ~/.bashrc files. Inside of /etc/profile you can see the application that runs which compiles the $*PATH variables from the /etc/*paths.d folders.

      /usr/libexec/path_helper

      Check out the man page for path_helper. It looks like it will only update $MANPATH with items from the manpaths.d folder if you are already updating it yourself!?

      From the man page: “The MANPATH environment variable will not be modified unless it is already set in the environment.”

      Here’s my setup:

      $ grep MANPATH .bash_profile
      MANPATH=$MANPATH:~/share/doc/man
      export MANPATH
      @(expressomaker)[~] 04:17:19
      $ echo $MANPATH
      /usr/share/man:/usr/local/share/man:/opt/local/lib/erlang/man:/usr/local/git/share/man:/usr/X11/share/man:/Users/tbielawa/share/doc/man

    • Bill Robertson

      04 Dec 2009 08:12 pm

      Very interesting. I’ll take a look at that. Thanks!

    • Macports updates their Erlang version @ Technitribe

      03 Feb 2010 12:02 am

      […] you fix your Emacs load-path to register the new location. (See my older post on how to initially set up Erlang and Emacs from MacPorts from […]

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    • The Authors
    • Virtual Disk Guide

      Interested in virtualization? Do QCOWs rule your filesystem? Are you a libvirt or KVM+QEMU wizard? I wrote a book about virtual disk management. Check out the The Linux Sysadmin's Guide to Virtual Disks online for free at ScribesGuides.com.


      Consider supporting the author by purchasing a hard copy of the first edition for just $10.00 on Lulu.com.

    • bitmath

      bitmath is a Python library for dealing with file size units (GiB's, kB's, etc) in a sane way. bitmath supports arithmetic, rich comparison, conversion, automatic best human-readable representation, and many other utility functions. Read some examples on the docs site or check out the source on GitHub.

    • latest posts

      • Querying block device sizes in Python on Linux and Mac OS X February 4, 2023
      • Using jq to filter an array of objects from JSON September 9, 2019
      • Two Year Break — And we’re back! November 16, 2018
    • tags

      bitmath blog conference css dblatex DNS DocBook eclipse Emacs Erlang Fedora fedora 22 filter GNU Screen Haiku Introduction java jboss LCSEE Linux locale locales fix slicehost ubuntu Macports module nist nXML-Mode opengl open source OS X package packaging pki prefix units presentation project pypi Python scholarship si summit Tutorial ubuntu xcode XML XMPP
    • h4ck teh world

      tbielawatbielawa
      • Issue Comment
        bitmath
        February 6, 2023 - 12:55 am UTC
      • Issue Comment
        bitmath
        February 6, 2023 - 12:54 am UTC
      • Push
        bitmath
        February 6, 2023 - 12:51 am UTC
      • Issue Comment
        bitmath
        February 6, 2023 - 12:36 am UTC
      • Push
        bitmath
        February 6, 2023 - 12:30 am UTC

Creative Commons License
Technitribe by Tim Bielawa is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.