diff options
author | Erlang/OTP <[email protected]> | 2010-05-26 10:23:17 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-05-26 10:23:17 +0000 |
commit | 8fd9db557fa1f45dce1717d52cfda45a3ebb2e3d (patch) | |
tree | b4d7e02cd9edce361edc84e43c1fedf48fe015d4 /lib/tools | |
parent | af0b84eff17bd6c8519ab6fd1e34a9200dbc6bef (diff) | |
parent | 85d5b7345e10720d10ea63d79bca282bcd44cdf7 (diff) | |
download | otp-8fd9db557fa1f45dce1717d52cfda45a3ebb2e3d.tar.gz otp-8fd9db557fa1f45dce1717d52cfda45a3ebb2e3d.tar.bz2 otp-8fd9db557fa1f45dce1717d52cfda45a3ebb2e3d.zip |
Merge branch 'mh/erlang-mode-imenu-arity' into dev
* mh/erlang-mode-imenu-arity:
Let imenu distinguish functions by arity
Diffstat (limited to 'lib/tools')
-rw-r--r-- | lib/tools/emacs/erlang.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index 365f026968..5d6b6c7529 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -1394,7 +1394,7 @@ Other commands: (set (make-local-variable 'imenu-prev-index-position-function) 'erlang-beginning-of-function) (set (make-local-variable 'imenu-extract-index-name-function) - 'erlang-get-function-name) + 'erlang-get-function-name-and-arity) (set (make-local-variable 'tempo-match-finder) "[^-a-zA-Z0-9_]\\([-a-zA-Z0-9_]*\\)\\=") (set (make-local-variable 'beginning-of-defun-function) @@ -3497,6 +3497,13 @@ Normally used in conjunction with `erlang-beginning-of-clause', e.g.: res) (error nil))))) +(defun erlang-get-function-name-and-arity () + "Return the name and arity of the function at point, or nil. +The return value is a string of the form \"foo/1\"." + (let ((name (erlang-get-function-name)) + (arity (erlang-get-function-arity))) + (and name arity (format "%s/%d" name arity)))) + (defun erlang-get-function-arguments () "Return arguments of current function, or nil." (if (not (looking-at (eval-when-compile |