diff options
author | Ivan Andrus <darthandrus@gmail.com> | 2013-06-29 14:12:41 -0600 |
---|---|---|
committer | Ivan Andrus <darthandrus@gmail.com> | 2013-06-29 21:39:47 -0600 |
commit | 5b6ec593d1754af9311c54bf26d53b96fb318dbd (patch) | |
tree | 84eb4397a8dc381977792a28040ec579be8822ce /Tools | |
parent | aafed7a41a2c194eca78e5fa8a6e3db166828117 (diff) | |
download | cython-5b6ec593d1754af9311c54bf26d53b96fb318dbd.tar.gz |
Added outline-regexp
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/cython-mode.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Tools/cython-mode.el b/Tools/cython-mode.el index fb6ebe4ec..fdf9caa0a 100644 --- a/Tools/cython-mode.el +++ b/Tools/cython-mode.el @@ -10,6 +10,7 @@ ;; Load python-mode if available, otherwise use builtin emacs python package (when (not (require 'python-mode nil t)) (require 'python)) +(eval-when-compile (require 'rx)) ;;;###autoload (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 \\{cython-mode-map}" (setcar font-lock-defaults (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) (format cython-default-compile-format (shell-quote-argument buffer-file-name))) (add-to-list (make-local-variable 'compilation-finish-functions) - 'cython-compilation-finish) -) + 'cython-compilation-finish)) (provide 'cython-mode) |