Permalink
Browse files

M-. on function definitions should call erl-who-calls.

  • Loading branch information...
1 parent 17ccc86 commit 0da3e32b2021e41a954f1db87bffdea99af992cd Robin Osterberg committed Sep 19, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 elisp/erl-service.el
View
@@ -743,6 +743,15 @@ We also don't prompt for the module name.")
((looking-back "\\?") (erl-macro-regex))
(t t))))
+(defvar erl-function-definition-regex
+ (concat "^" erlang-atom-regexp "\\s *(")
+ "Regex for finding function definitions")
+
+(defun erlang-at-function-definition-p ()
+ (save-excursion
+ (beginning-of-line)
+ (looking-at erl-function-definition-regex)))
+
(defun erl-find-source-under-point ()
"When trying to find a function definition checks to see if we
are standing on a macro instead."
@@ -752,6 +761,8 @@ We also don't prompt for the module name.")
(erl-open-header-file-under-point))
((listp patterns)
(erl-find-source-pattern-under-point patterns))
+ ((erlang-at-function-definition-p)
+ (erl-who-calls (erl-target-node)))
(t
(erl-find-function-under-point)))))

0 comments on commit 0da3e32

Please sign in to comment.