diff options
author | Dan Gudmundsson <[email protected]> | 2010-02-24 16:43:38 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-03-15 14:09:50 +0100 |
commit | 824ba9639ef6973c4c26b86616b2625b37ef2595 (patch) | |
tree | 42df62a133886d2d0c1b892d4c88d24a48580325 /lib | |
parent | 0f126f708342a8f0c067855851ff7c8bbce403f0 (diff) | |
download | otp-824ba9639ef6973c4c26b86616b2625b37ef2595.tar.gz otp-824ba9639ef6973c4c26b86616b2625b37ef2595.tar.bz2 otp-824ba9639ef6973c4c26b86616b2625b37ef2595.zip |
Fix electric semi-colon and tuples inside lists
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tools/emacs/erlang.el | 9 | ||||
-rw-r--r-- | lib/tools/emacs/test.erl.indented | 8 | ||||
-rw-r--r-- | lib/tools/emacs/test.erl.orig | 8 |
3 files changed, 21 insertions, 4 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index da586ee09a..be2c10ab88 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -2874,8 +2874,8 @@ Return nil if inside string, t if in a comment." (+ base erlang-indent-level)) (t (goto-char indent-point) - (cond ((memq (following-char) '(?\( ?{)) - ;; Function application or record. + (cond ((memq (following-char) '(?\( )) + ;; Function application. (+ (erlang-indent-find-preceding-expr) erlang-argument-indent)) ;; Empty line, or end; treat it as the end of @@ -3472,8 +3472,8 @@ Normally used in conjunction with `erlang-beginning-of-clause', e.g.: (erlang-get-function-arrow)))" (and (save-excursion - (re-search-forward "[^-:]*-\\|:" (point-max) t) - (erlang-buffer-substring (- (point) 1) (+ (point) 1))))) + (re-search-forward "->" (point-max) t) + (erlang-buffer-substring (- (point) 2) (+ (point) 1))))) (defun erlang-get-function-arity () "Return the number of arguments of function at point, or nil." @@ -3677,6 +3677,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) (if (condition-case nil diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented index 1ccced9177..45b876f718 100644 --- a/lib/tools/emacs/test.erl.indented +++ b/lib/tools/emacs/test.erl.indented @@ -349,6 +349,14 @@ indent_basics(X, Y, Z) % AD added clause foo. + +indent_nested() -> + [ + {foo, 2, "string"}, + {bar, 3, "another string"} + ]. + + indent_icr(Z) -> % icr = if case receive %% If if Z >= 0 -> diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig index 9b4203120b..bae17d3ff0 100644 --- a/lib/tools/emacs/test.erl.orig +++ b/lib/tools/emacs/test.erl.orig @@ -349,6 +349,14 @@ indent_basics(X, Y, Z) % AD added clause foo. + +indent_nested() -> + [ + {foo, 2, "string"}, + {bar, 3, "another string"} + ]. + + indent_icr(Z) -> % icr = if case receive %% If if Z >= 0 -> |