summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorIvan Andrus <darthandrus@gmail.com>2013-06-29 13:40:18 -0600
committerIvan Andrus <darthandrus@gmail.com>2013-06-29 21:39:47 -0600
commitaafed7a41a2c194eca78e5fa8a6e3db166828117 (patch)
tree179000cdd631cb37f7e8d736b9befb052bf9ddc2 /Tools
parent367e0740b682fad334cc36fda4f1e66a1519a888 (diff)
downloadcython-aafed7a41a2c194eca78e5fa8a6e3db166828117.tar.gz
Made compile-command customizable
Diffstat (limited to 'Tools')
-rw-r--r--Tools/cython-mode.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/Tools/cython-mode.el b/Tools/cython-mode.el
index e0aa05613..fb6ebe4ec 100644
--- a/Tools/cython-mode.el
+++ b/Tools/cython-mode.el
@@ -30,8 +30,7 @@
(compile compile-command)
(set (make-local-variable 'cython-buffer) cy-buffer)
(add-to-list (make-local-variable 'compilation-finish-functions)
- 'cython-compilation-finish)))
- )
+ 'cython-compilation-finish))))
(defun cython-compilation-finish (buffer how)
"Called when Cython compilation finishes."
@@ -64,6 +63,19 @@
"Additional font lock keywords for Cython mode.")
;;;###autoload
+(defgroup cython nil "Major mode for editing and compiling Cython files"
+ :group 'languages
+ :prefix "cython-"
+ :link '(url-link :tag "Homepage" "http://cython.org"))
+
+;;;###autoload
+(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)
+
+;;;###autoload
(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)
'cython-compilation-finish)
)