aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2011-05-03 11:30:33 +0200
committerHenrik Nord <[email protected]>2011-05-03 11:30:37 +0200
commit56b5f9e580f0ffaf13f95019bf409b55fd890d97 (patch)
tree7fb2d352527a4091ec1024d91b6471d5b1479fa6
parent6f03c25ec03a743c1e707b70839973a05b431095 (diff)
parentc0c600a58532b132b0b85d7a835ac485edb9a477 (diff)
downloadotp-56b5f9e580f0ffaf13f95019bf409b55fd890d97.tar.gz
otp-56b5f9e580f0ffaf13f95019bf409b55fd890d97.tar.bz2
otp-56b5f9e580f0ffaf13f95019bf409b55fd890d97.zip
Merge branch 'mh/inhibit-newline-inside-typespec' into dev
* mh/inhibit-newline-inside-typespec: Inhibit electric newline after "->" when inside a type spec OTP-9255
-rw-r--r--lib/tools/emacs/erlang.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index e1c0d31371..6728bef2a4 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -386,7 +386,8 @@ then no prototype is inserted.
The test is performed by the function `erlang-test-criteria-list'.")
(defvar erlang-electric-arrow-criteria
- '(erlang-next-lines-empty-p
+ '(erlang-stop-when-in-type-spec
+ erlang-next-lines-empty-p
erlang-at-end-of-function-p)
"*List of functions controlling the arrow aspect of `erlang-electric-gt'.
The functions in this list are called, in order, whenever a `>'
@@ -4045,6 +4046,16 @@ This function is designed to be a member of a criteria list."
nil)))
+(defun erlang-stop-when-in-type-spec ()
+ "Return `stop' when in a type spec line.
+
+This function is designed to be a member of a criteria list."
+ (save-excursion
+ (beginning-of-line)
+ (when (save-match-data (looking-at "-\\(spec\\|type\\)"))
+ 'stop)))
+
+
(defun erlang-next-lines-empty-p ()
"Return non-nil if next lines are empty.