Created
January 25, 2017 09:51
-
-
Save RyanKung/6e95257a40f53d249c4a4d280eef8132 to your computer and use it in GitHub Desktop.
simple Emacs major-mode implementation for metatrader4 editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; mt4.el ---- major-mode for metatrader 4 | |
;; Copyright (c) 2017 Ryan Kung | |
;; Author: Ryan Kung <ryankung@ieee.org> | |
;; Keywords: metatrader mt4 mql4 | |
;;; Commentary: | |
;;; Code: | |
(defvar mql-compiler | |
"wine '/Users/xxxx/Applications/Wineskin/MetaTrader 4.app/drive_c/Program Files/BTC-e Exchange MT4/metaeditor.exe'") | |
(defun compile-mql (&optional file) | |
"Compile current FILE." | |
(interactive) | |
(let* ((filename (or file load-file-name buffer-file-name)) | |
(path (file-name-directory filename)) | |
(command (format "%s /compile:'%s/%s' /log" mql-compiler path filename))) | |
(async-shell-command command))) | |
;;;###autoload | |
(define-derived-mode mt4-mode c-mode "mt4" | |
"major mode for editing mt4 language code." | |
(local-set-key (kbd "C-x c") 'compile-mql) | |
) | |
(provide 'mt4) | |
;;; mt4.el ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment