Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
e3772e98
Commit
e3772e98
authored
May 15, 2013
by
Leo Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* progmodes/octave.el (octave-goto-function-definition): Improve
and fix callers.
parent
c46c57b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/progmodes/octave.el
lisp/progmodes/octave.el
+15
-7
No files found.
lisp/ChangeLog
View file @
e3772e98
2013-05-15 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (octave-goto-function-definition): Improve
and fix callers.
2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl-extra.el (cl-getf): Return the proper value in
...
...
lisp/progmodes/octave.el
View file @
e3772e98
...
...
@@ -928,13 +928,21 @@ directory and makes this the current buffer's default directory."
inferior-octave-completion-table
nil
nil
nil
nil
def
)))
(
defun
octave-goto-function-definition
()
"Go to the f
irst function definition
."
(
defun
octave-goto-function-definition
(
fn
)
"Go to the f
unction definition of FN in current buffer
."
(
goto-char
(
point-min
))
(
if
(
not
(
re-search-forward
octave-function-header-regexp
nil
t
))
(
forward-comment
(
point-max
))
(
goto-char
(
match-beginning
3
))
(
match-string
3
)))
(
let
((
search
(
lambda
(
re
sub
)
(
let
(
done
)
(
while
(
and
(
not
done
)
(
re-search-forward
re
nil
t
))
(
when
(
and
(
equal
(
match-string
sub
)
fn
)
(
not
(
nth
8
(
syntax-ppss
))))
(
setq
done
t
)))
(
or
done
(
goto-char
(
point-min
)))))))
(
pcase
(
file-name-extension
(
buffer-file-name
))
(
`
"cc"
(
funcall
search
"\\_<DEFUN\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)"
1
))
(
t
(
funcall
search
octave-function-header-regexp
3
)))))
(
defun
octave-function-file-p
()
"Return non-nil if the first token is \"function\".
...
...
@@ -1686,7 +1694,7 @@ if iskeyword(\"%s\") disp(\"`%s' is a keyword\") else which(\"%s\") endif\n"
(
setq
file
(
funcall
octave-find-definition-filename-function
file
))
(
when
file
(
find-file
file
)
(
octave-goto-function-definition
)))
))
(
octave-goto-function-definition
fn
)))
))
(
provide
'octave
)
...
...
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