Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
0e5d211f
Commit
0e5d211f
authored
Jun 29, 2013
by
Ivan Andrus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cython-current-defun for add-log-current-defun-function
parent
f12b30ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
Tools/cython-mode.el
Tools/cython-mode.el
+20
-0
No files found.
Tools/cython-mode.el
View file @
0e5d211f
...
...
@@ -223,6 +223,23 @@ Finds end of innermost nested class or method definition."
(
if
(
<
(
point
)
orig
)
(
goto-char
(
point-max
)))))
(
defun
cython-current-defun
()
"`add-log-current-defun-function' for Cython."
(
save-excursion
;; Move up the tree of nested `class' and `def' blocks until we
;; get to zero indentation, accumulating the defined names.
(
let
((
start
t
)
accum
)
(
while
(
or
start
(
>
(
current-indentation
)
0
))
(
setq
start
nil
)
(
cython-beginning-of-block
)
(
end-of-line
)
(
beginning-of-defun
)
(
if
(
looking-at
(
rx
(
0+
space
)
(
or
"def"
"cdef"
"cpdef"
"class"
)
(
1+
space
)
(
group
(
1+
(
or
word
(
syntax
symbol
))))))
(
push
(
match-string
1
)
accum
)))
(
if
accum
(
mapconcat
'identity
accum
"."
)))))
;;;###autoload
(
define-derived-mode
cython-mode
python-mode
"Cython"
"Major mode for Cython development, derived from Python mode.
...
...
@@ -240,6 +257,9 @@ Finds end of innermost nested class or method definition."
#'
cython-end-of-defun
)
(
set
(
make-local-variable
'compile-command
)
(
format
cython-default-compile-format
(
shell-quote-argument
buffer-file-name
)))
(
set
(
make-local-variable
'add-log-current-defun-function
)
#'
cython-current-defun
)
(
add-hook
'which-func-functions
#'
cython-current-defun
nil
t
)
(
add-to-list
(
make-local-variable
'compilation-finish-functions
)
'cython-compilation-finish
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment