Commit aafed7a4 authored by Ivan Andrus's avatar Ivan Andrus

Made compile-command customizable

parent 367e0740
......@@ -30,8 +30,7 @@
(compile compile-command)
(set (make-local-variable 'cython-buffer) cy-buffer)
(add-to-list (make-local-variable 'compilation-finish-functions)
(defun cython-compilation-finish (buffer how)
"Called when Cython compilation finishes."
......@@ -63,6 +62,19 @@
1 font-lock-function-name-face))
"Additional font lock keywords for Cython mode.")
(defgroup cython nil "Major mode for editing and compiling Cython files"
:group 'languages
:prefix "cython-"
:link '(url-link :tag "Homepage" ""))
(defcustom cython-default-compile-format "cython -a %s"
"Format for the default command to compile a Cython file.
It will be passed to `format' with `buffer-file-name' as the only other argument."
:group 'cython
:type 'string)
(define-derived-mode cython-mode python-mode "Cython"
"Major mode for Cython development, derived from Python mode.
......@@ -71,7 +83,7 @@
(setcar font-lock-defaults
(append python-font-lock-keywords cython-font-lock-keywords))
(set (make-local-variable 'compile-command)
(concat "cython -a " buffer-file-name))
(format cython-default-compile-format (shell-quote-argument buffer-file-name)))
(add-to-list (make-local-variable 'compilation-finish-functions)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment