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

Roberto Saccon rsaccon@REDACTED
Wed Jun 27 15:14:59 CEST 2007


Interesting approach, thanks for sharing. There is one this however I
do not understand from looking at your elisp code: make:all() looks in
the directory  where the VM has started for an Emakefile. How does
that magically happen with your approach, if you have a folder
structure with several source directories, each one with its own
Emakefile ?

regards
Roberto

On 6/27/07, Alexey Lebedeff <a.lebedeff@REDACTED> wrote:
>
>  RS> Does anybody know how to also add the distel module reloading to the
>  RS> compile shortcut ?
>
> I'm using following function to compile and load erlang programs.
> It issues "make:all([load])." command to remote node, so i can edit(with
> Tramp) and compile files on remote machines.
>
> (defun erlang-remote-compile ()
>   (interactive)
>   (save-some-buffers (not compilation-ask-about-save) nil)
>   (save-excursion
>     (let ((thisdir default-directory))
>       (with-current-buffer (get-buffer-create "*erl-output*")
>         (setq default-directory thisdir)
>         (erase-buffer)
>         (compilation-mode)
>         (toggle-read-only nil)
>         (setq compilation-current-error nil)
>         (display-buffer (current-buffer))
>         (erl-spawn
>           (erl-send-rpc (erl-target-node)
>                         'distel
>                         'eval_expression
>                         (list "make:all([load])."))
>           (erl-receive ()
>               ((['rex ['ok string]]
>                 (insert string))
>                (['rex ['error reason]]
>                 (insert reason))
>                (other
>                 (message "Unexpected: %S" other)))))))))
>
>
>
>
>  RS> I tried with:
>
>  RS> (global-set-key [f9] (lambda () (interactive) (progn (save-buffer)
>  RS> (erlang-compile) (erl-reload-modules))))
>
>  RS> but got this error message:
>
>  RS> Waiting for Erlang shell prompt (press C-g to abort). [2 times]
> progn>: Wrong number of arguments: (lambda (node) "reload all out-of-date
>  RS> modules" (interactive (list (erl-target-node))) (erl-rpc (lambda
>  RS> (result) (message "load: %s" result)) nil node (quote distel) (quote
>  RS> reload_modules) nil)), 0
>
>  RS> -- Roberto Saccon _______________________________________________
>  RS> erlang-questions mailing list erlang-questions@REDACTED
>
> http>://www.erlang.org/mailman/listinfo/erlang-questions
>
>
> --
> [1180'99:11-6a] [BMSTU:AK5-111]
>


-- 
Roberto Saccon



More information about the erlang-questions mailing list