From 5b0418e2f5e70d9eeadcfc2009bd7c69e336c939 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 15 Dec 2009 12:24:40 +0100 Subject: Added a indentation when using electric-comma. In the following code case X of foo -> 25 end, Automatically indent the line you stand on (end,) before adding newline and indent again. That way 'end' will be indented correctly after the comma is written. --- lib/tools/emacs/erlang.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/tools/emacs/erlang.el') diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index f623e3a1ee..6d6f9e24f4 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -4946,6 +4946,7 @@ non-whitespace characters following the point on the current line." (setq erlang-electric-newline-inhibit nil) (setq erlang-electric-newline-inhibit t) (undo-boundary) + (erlang-indent-line) (end-of-line) (newline) (condition-case nil -- cgit v1.2.3 From 889208661105bf2e296c168ed0afa7452db137df Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 15 Dec 2009 13:38:58 +0100 Subject: Fixed indentation of -spec() -> Var :: type(); --- lib/tools/emacs/erlang.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/tools/emacs/erlang.el') diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index 6d6f9e24f4..b352ae7cce 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -72,7 +72,7 @@ ;; Variables: -(defconst erlang-version "2.6.1" +(defconst erlang-version "2.6.2" "The version number of Erlang mode.") (defvar erlang-root-dir nil @@ -3792,9 +3792,9 @@ Value is list (stack token-start token-type in-what)." ;; Clause end ((= (following-char) ?\;) - (if (and stack (and (eq (car (car stack)) 'when) - (eq (car (car (cdr (cdr stack)))) 'spec))) - (erlang-pop stack)) + (if (eq (car (car (last stack))) 'spec) + (while (memq (car (car stack)) '(when ::)) + (erlang-pop stack))) (if (and stack (eq (car (car stack)) '->)) (erlang-pop stack)) (forward-char 1)) -- cgit v1.2.3