Skip to content
No description or website provided.
Shell Ruby
Pull request Compare This branch is 8 commits ahead, 3 commits behind heroku:master.
Latest commit 3fbf047 Aug 17, 2012 @technomancy Merge pull request #2 from nicferrier/master
here are my changes, if you want them
Failed to load latest commit information.
bin
README.md markup change Aug 15, 2012

README.md

Heroku buildpack: Emacs Lisp

This is an Emacs Lisp Heroku buildpack for Elnode.

First make sure you have at LEAST heroku gem version 2.11.0+

Usage

Make a git repository with a file start-elnode.el:

;;; start-elnode.el
(setq package-archives '(("marmalade" . "http://marmalade-repo.org/packages/")))
(package-initialize)
(package-refresh-contents)
(package-install 'elnode)

(defun handler (httpcon)
  "Demonstration function"
  (elnode-http-start httpcon "200"
                     '("Content-type" . "text/html")
                     `("Server" . ,(concat "GNU Emacs " emacs-version)))
  (elnode-http-return httpcon "<html><body><h1>Hello from Emacs!</h1></body></html>"))

(elnode-start 
    'handler 
    :port (string-to-number (or (getenv "PORT") "8080")) 
    :host "0.0.0.0")

(while t (accept-process-output nil 1))

add heroku as a remote to the repo:

$ heroku create --stack cedar --buildpack http://github.com/nicferrier/heroku-buildpack-emacs.git

and then deploy the app by pushing to heroku:

$ git push heroku master
...
-----> Heroku receiving push
-----> Fetching custom buildpack
-----> Emacs Lisp app detected
-----> Downloading Emacs 24.0.50.1
       Downloading Emacs 24 pretest from github
       ...done

The buildpack will detect that your app has a start-elnode.el in the root and download a copy of the Emacs 24 pretest to bundle in your slug. The Procfile for Emacs Lisp apps currently needs to untar that copy of Emacs before running and symlink it to /tmp/emacs, like this:

web: tar xzf emacs.tar.gz && ln -s $PWD/emacs /tmp/emacs; emacs/bin/emacs --daemon --load start-elnode.el

Re-compiling the buildpack Emacs

The current Emacs tarball is compiled from the pretest of version 24 with this invocation:

$ ./configure --without-x --without-sound --without-xpm \
--without-jpeg --without-tiff --without-gif --without-png \
--without-rsvg --without-xml2 --without-imagemagick --without-xft \
--without-toolkit-scroll-bars --without-gconf --without-dbus \
--without-gsettings --without-selinux --without-gnutls --without-gpm \
--without-makeinfo --without-compress-info --prefix=/tmp/emacs
Something went wrong with that request. Please try again.