[haXe] haxe-mode version 0.1.0 for Emacs
Vadim Atlygin
vava at tepkom.ru
Thu Dec 21 15:27:07 CET 2006
Hi Jens and all,
I haven't tried your mode yet but definitely will ASAP. Also I made a
small function for compiling haxe code from Emacs, maybe it will be
useful for you.
It will search for hxml files up the directory tree and run them all at
once. Just run save-and-make :)
(defun find-directory-with-projects (directory)
(if (eq (length (directory-files directory t ".*\.hxml")) 0)
(find-directory-with-projects (concat "../" directory)) directory)
)
(defun construct-make-command (file-list)
(setq command "")
(while file-list
(setq quote-string (make-string (- (lsh 1 (- (length file-list) 1))
1) ?\\))
(setq command
(cond
((string-match command "") (format "haxe %s" (car file-list)))
(t (format (concat "haxe -cmd " quote-string "\"%s" quote-string
"\" %s") command (car file-list)))))
(setq file-list (cdr file-list)))
command
)
(defun save-and-make (ask)
(interactive "p")
(save-buffer (current-buffer))
(setq compilation-ask-about-save nil)
(setq compilation-window-height 7)
(setq compilation-finish-function
(lambda (buf str)
(if (not(string-match "exited abnormally" str))
(run-at-time 1 nil 'delete-windows-on buf)
(as-compilation-finish buf str)
)
(setq compilation-finish-function nil)
))
(setq directory (find-directory-with-projects ""))
(setq default-directory (concat (expand-file-name directory) "/"))
(setq compile-command (construct-make-command (directory-files
directory nil ".*\.hxml" )))
(compile compile-command)
)
Jens Peter Secher wrote:
> Hi *.
>
> I have attached my initial attempt on making a haXe mode for Emacs.
> It think requires CC Mode 5.31, but I have not tested with older
> versions, so please let me know...
>
> If you need to upgrade your CC mode, the easiest way is to remove all
> old cc-* files
> (eg. in c:/Program Files/emacs/lisp/progmodes/) and put the new ones
> in site-lisp (eg. c:/Program Files/emacs/site-lisp/cc-mode-5.31.3/).
>
> Cheers,
More information about the Haxe
mailing list