diff options
author | Dan Gudmundsson <[email protected]> | 2009-12-17 16:56:25 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2009-12-17 16:56:25 +0100 |
commit | 55e80d74897ec16b80632fd7acdabdca764aea57 (patch) | |
tree | 92a5b569c65dfa8a0d85677a89e44f4e18f564ca /lib | |
parent | cb62972ca24198cc13e030adbd0b8a757bdb293c (diff) | |
download | otp-55e80d74897ec16b80632fd7acdabdca764aea57.tar.gz otp-55e80d74897ec16b80632fd7acdabdca764aea57.tar.bz2 otp-55e80d74897ec16b80632fd7acdabdca764aea57.zip |
More -spec indentation fixes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tools/emacs/erlang.el | 29 | ||||
-rw-r--r-- | lib/tools/emacs/test.erl.indented | 16 | ||||
-rw-r--r-- | lib/tools/emacs/test.erl.orig | 16 |
3 files changed, 44 insertions, 17 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index b352ae7cce..4b8911b758 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -4105,19 +4105,22 @@ Return nil if inside string, t if in a comment." (+ 2 (nth 2 stack-top))) ((looking-at "::[^_a-zA-Z0-9]") (nth 2 stack-top)) - (t - (goto-char (nth 1 stack-top)) - (cond ((looking-at "::\\s *\\($\\|%\\)") - ;; Line ends with :: - (+ (erlang-indent-find-preceding-expr 2) - erlang-argument-indent)) - ;; (* 2 erlang-indent-level)) - (t - ;; Indent to the same column as the first - ;; argument. - (goto-char (+ 2 (nth 1 stack-top))) - (skip-chars-forward " \t") - (current-column)))))) + (t + (let ((start-alternativ (if (looking-at "|") 2 0))) + (goto-char (nth 1 stack-top)) + (- (cond ((looking-at "::\\s *\\($\\|%\\)") + ;; Line ends with :: + (if (eq (car (car (last stack))) 'spec) + (+ (erlang-indent-find-preceding-expr 1) + erlang-argument-indent) + (+ (erlang-indent-find-preceding-expr 2) + erlang-argument-indent))) + (t + ;; Indent to the same column as the first + ;; argument. + (goto-char (+ 2 (nth 1 stack-top))) + (skip-chars-forward " \t") + (current-column))) start-alternativ))))) ))) diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented index 1d91b2f155..1a6292d90b 100644 --- a/lib/tools/emacs/test.erl.indented +++ b/lib/tools/emacs/test.erl.indented @@ -51,8 +51,10 @@ -type ann() :: Var :: integer(). -type ann2() :: Var :: - 'return' | 'return_white_spaces' | 'return_comments' - | 'text' | ann(). + 'return' + | 'return_white_spaces' + | 'return_comments' + | 'text' | ann(). -type paren() :: (ann2()). -type t1() :: atom(). @@ -116,6 +118,16 @@ (T :: tuple()) -> R3 :: bar:typen(). -spec mod:t2() -> any(). + +-spec handle_cast(Cast :: {'exchange', node(), [[name(),...]]} + | {'del_member', name(), pid()}, + #state{}) -> {'noreply', #state{}}. + +-spec handle_cast(Cast :: + {'exchange', node(), [[name(),...]]} + | {'del_member', name(), pid()}, + #state{}) -> {'noreply', #state{}}. + -opaque attributes_data() :: [{'column', column()} | {'line', info_line()} | {'text', string()}] | {line(),column()}. diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig index 049fc21286..499961cbb1 100644 --- a/lib/tools/emacs/test.erl.orig +++ b/lib/tools/emacs/test.erl.orig @@ -51,8 +51,10 @@ -type ann() :: Var :: integer(). -type ann2() :: Var :: - 'return' | 'return_white_spaces' | 'return_comments' - | 'text' | ann(). + 'return' + | 'return_white_spaces' + | 'return_comments' + | 'text' | ann(). -type paren() :: (ann2()). -type t1() :: atom(). @@ -116,6 +118,16 @@ t15(),t20(),t21(), t22(),t25()}. (T :: tuple()) -> R3 :: bar:typen(). -spec mod:t2() -> any(). + +-spec handle_cast(Cast :: {'exchange', node(), [[name(),...]]} + | {'del_member', name(), pid()}, + #state{}) -> {'noreply', #state{}}. + +-spec handle_cast(Cast :: + {'exchange', node(), [[name(),...]]} + | {'del_member', name(), pid()}, + #state{}) -> {'noreply', #state{}}. + -opaque attributes_data() :: [{'column', column()} | {'line', info_line()} | {'text', string()}] | {line(),column()}. |