aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid N. Welton <[email protected]>2014-10-06 14:26:04 +0200
committerDavid N. Welton <[email protected]>2014-10-06 14:26:56 +0200
commita29b3d3252d26032fbc0ce5b8187e43c015df1e3 (patch)
treea0d5630c9a2a1da38adbe8d5e2d64295e9c1121e /lib
parent8aa3475bba30fed67c1d886fc4bb5910a196db6c (diff)
downloadotp-a29b3d3252d26032fbc0ce5b8187e43c015df1e3.tar.gz
otp-a29b3d3252d26032fbc0ce5b8187e43c015df1e3.tar.bz2
otp-a29b3d3252d26032fbc0ce5b8187e43c015df1e3.zip
First attempt at adding a skel for -spec's
New skel adds a -spec for the function after point.
Diffstat (limited to 'lib')
-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 b37d08e767..42599e6428 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)
@@ -147,6 +148,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
@@ -1546,6 +1551,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: