Xemacs ../ebin and ../include

Luke Gorrie <>
Thu Sep 25 12:37:34 CEST 2003


"Vlad Dumitrescu" <> writes:

> I think you have to tweak the emacs.el file, to add these parameters
> to the compile command that is generated when pressing C-c C-k. The
> simple way is to hardcode them, the diffucult one is to provide a
> way to set them from Emacs (I wish I knew exactly how myself :-)

Attached is a patch to erlang.el to make C-c C-k compile into ../ebin
if that directory exists, and otherwise use the current directory as
usual. I hope I hacked a recent version of erlang.el but I've lost
track a bit - let me know if you want help.

BTW, personally I prefer to use the Emacs `make' command because it
gives nice summaries of compiler errors. I use a small hack so that if
there is a Makefile in the directory it runs make, otherwise it just
calls erlc to compile the file. The only downside is that the module
isn't loaded automatically, but I use Distel for that (C-c C-d L).

Here is an example of configuring the `make' command to compile
individual Erlang files when there is no Makefile:

  (defun my-erlang-mode-hook ()
    (make-local-variable 'compile-command)
    (setq compile-command
          (if (file-exists-p "Makefile")
              "make -k"
            (concat "erlc +debug_info -W " (buffer-file-name)))))

  (add-hook 'erlang-mode-hook 'my-erlang-mode-hook)

For an example of painless Makefiles see the programs in the Jungerl
on sourceforge at http://sf.net/projects/jungerl/

Cheers,
Luke

-------------- next part --------------
A non-text attachment was scrubbed...
Name: erlang-outdir.patch
Type: text/x-patch
Size: 1061 bytes
Desc: erlang.el patch to compile into ../ebin/ if it exists
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20030925/1c9d0c28/attachment.bin>


More information about the erlang-questions mailing list