Commit 5b6ec593 authored by Ivan Andrus's avatar Ivan Andrus

Added outline-regexp

parent aafed7a4
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
;; Load python-mode if available, otherwise use builtin emacs python package ;; Load python-mode if available, otherwise use builtin emacs python package
(when (not (require 'python-mode nil t)) (when (not (require 'python-mode nil t))
(require 'python)) (require 'python))
(eval-when-compile (require 'rx))
;;;###autoload ;;;###autoload
(add-to-list 'auto-mode-alist '("\\.pyx\\'" . cython-mode)) (add-to-list 'auto-mode-alist '("\\.pyx\\'" . cython-mode))
...@@ -82,11 +83,14 @@ It will be passed to `format' with `buffer-file-name' as the only other argument ...@@ -82,11 +83,14 @@ It will be passed to `format' with `buffer-file-name' as the only other argument
\\{cython-mode-map}" \\{cython-mode-map}"
(setcar font-lock-defaults (setcar font-lock-defaults
(append python-font-lock-keywords cython-font-lock-keywords)) (append python-font-lock-keywords cython-font-lock-keywords))
(set (make-local-variable 'outline-regexp)
(rx (* space) (or "class" "def" "cdef" "cpdef" "elif" "else" "except" "finally"
"for" "if" "try" "while" "with")
symbol-end))
(set (make-local-variable 'compile-command) (set (make-local-variable 'compile-command)
(format cython-default-compile-format (shell-quote-argument buffer-file-name))) (format cython-default-compile-format (shell-quote-argument buffer-file-name)))
(add-to-list (make-local-variable 'compilation-finish-functions) (add-to-list (make-local-variable 'compilation-finish-functions)
'cython-compilation-finish) 'cython-compilation-finish))
)
(provide 'cython-mode) (provide 'cython-mode)
......
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