[erlang-questions] Autosaving *.erl in emacs before compilation

Jim Menard <>
Mon Jun 11 14:24:39 CEST 2007


On 6/11/07, Kirill Zaborski <> wrote:
> Playing around with erlang and emacs I almost always forget to save the
> buffer before compiling it so I get an almost unnecessary prompt. Not so
> much  time spent  but it annoys a bit. And pressing C-x C-s takes some time
> also :)
> Does anybody know how to run saving automatically before compilation?

erlang-compile-function is a variable that's bound to
inferior-erlang-compile by default. You could write your own function
to replace it and bind that to erlang-compile-function instead.

Here is some UNTESTED code:

(defun my-inferior-erlang-compile ()
  "Save the current buffer, then call inferior-erlang-compile."
  (interactive)
  (save-current-buffer
    (inferior-erlang-compile)))

(defvar erlang-compile-function 'my-inferior-erlang-compile)

Jim
-- 
Jim Menard, , 
http://www.io.com/~jimm/



More information about the erlang-questions mailing list