aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Yinhe <[email protected]>2014-11-04 09:17:36 +0100
committerBruce Yinhe <[email protected]>2014-11-04 09:17:36 +0100
commit490b65a768d79ff1b9abdb23f29401f961d6f126 (patch)
treeafdc70d47988437578c9e33279faebc66fdebe33
parentb94adca1ddfc73844441eda1791bb63fdef18cf3 (diff)
parente4f1f02cd2e5fbb578197fa28cdf7aca31f7f28e (diff)
downloadotp-490b65a768d79ff1b9abdb23f29401f961d6f126.tar.gz
otp-490b65a768d79ff1b9abdb23f29401f961d6f126.tar.bz2
otp-490b65a768d79ff1b9abdb23f29401f961d6f126.zip
Merge branch 'maint'
-rw-r--r--lib/tools/emacs/erlang-skels.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tools/emacs/erlang-skels.el b/lib/tools/emacs/erlang-skels.el
index af2c687fdc..78929ac510 100644
--- a/lib/tools/emacs/erlang-skels.el
+++ b/lib/tools/emacs/erlang-skels.el
@@ -31,6 +31,7 @@
("Module" "module" erlang-skel-module)
("Author" "author" erlang-skel-author)
("Function" "function" erlang-skel-function)
+ ("Spec" "spec" erlang-skel-spec)
()
("Small Header" "small-header"
erlang-skel-small-header erlang-skel-header)
@@ -149,6 +150,10 @@ Please see the function `tempo-define-template'.")
"*The template of a function skeleton.
Please see the function `tempo-define-template'.")
+(defvar erlang-skel-spec
+ '("-spec " (erlang-skel-get-function-name) "(" (erlang-skel-get-function-args) ") -> undefined.")
+ "*The template of a -spec for the function following point.
+Please see the function `tempo-define-template'.")
;; Attribute templates
@@ -1679,6 +1684,16 @@ The first character of DD is space if the value is less than 10."
(substring date 4 7)
(substring date -4))))
+(defun erlang-skel-get-function-name ()
+ (save-excursion
+ (erlang-beginning-of-function -1)
+ (erlang-get-function-name)))
+
+(defun erlang-skel-get-function-args ()
+ (save-excursion
+ (erlang-beginning-of-function -1)
+ (erlang-get-function-arguments)))
+
;; Local variables:
;; coding: iso-8859-1
;; End: