summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorIvan Andrus <darthandrus@gmail.com>2013-06-29 14:12:41 -0600
committerIvan Andrus <darthandrus@gmail.com>2013-06-29 21:39:47 -0600
commit5b6ec593d1754af9311c54bf26d53b96fb318dbd (patch)
tree84eb4397a8dc381977792a28040ec579be8822ce /Tools
parentaafed7a41a2c194eca78e5fa8a6e3db166828117 (diff)
downloadcython-5b6ec593d1754af9311c54bf26d53b96fb318dbd.tar.gz
Added outline-regexp
Diffstat (limited to 'Tools')
-rw-r--r--Tools/cython-mode.el8
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)