Refactor command line creation.
[erlware-mode.git] / erlang-sinan.el
blob6d0b515a44ca68bb352672b7343b2dc89ccf89ec
1 ;; erlang-sinan.el --- Functions for launching sinan commands.
3 ;; Author: Dave Peticolas
4 ;; Version: 0.1
5 ;; Keywords: erlang, sinan, erlware
6 ;; Created: 2007-09-18
7 ;; Date: 2008-01-01
10 (require 'compile)
13 (defun erlang-sinan-run-command (&optional args)
14 "Run sinan with the command given as an argument. Runs sinan
15 in a separate process asynchronously with output going to the
16 buffer `*sinan*'."
17 (interactive)
18 (save-some-buffers)
19 (let ((cmd (string-join " " (cons "sinan" args))))
20 (compile-internal cmd "No more errors." "sinan")))
22 (defun erlang-sinan-build ()
23 (interactive)
24 (erlang-sinan-run-command))
26 (defun string-join (joiner strings)
27 (string-join-accum joiner strings ""))
29 (defun string-join-accum (joiner strings accum)
30 (cond ((not strings) accum)
31 ((not (cdr strings)) (concat accum (car strings)))
32 (t (string-join-accum joiner (cdr strings)
33 (concat accum (car strings) joiner)))))