Skip to content

Instantly share code, notes, and snippets.

@RyanKung
Created January 25, 2017 09:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanKung/6e95257a40f53d249c4a4d280eef8132 to your computer and use it in GitHub Desktop.
Save RyanKung/6e95257a40f53d249c4a4d280eef8132 to your computer and use it in GitHub Desktop.
simple Emacs major-mode implementation for metatrader4 editor
;;; 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