aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/emacs/erlang.el
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2009-12-17 16:56:25 +0100
committerDan Gudmundsson <[email protected]>2009-12-17 16:56:25 +0100
commit55e80d74897ec16b80632fd7acdabdca764aea57 (patch)
tree92a5b569c65dfa8a0d85677a89e44f4e18f564ca /lib/tools/emacs/erlang.el
parentcb62972ca24198cc13e030adbd0b8a757bdb293c (diff)
downloadotp-55e80d74897ec16b80632fd7acdabdca764aea57.tar.gz
otp-55e80d74897ec16b80632fd7acdabdca764aea57.tar.bz2
otp-55e80d74897ec16b80632fd7acdabdca764aea57.zip
More -spec indentation fixes.
Diffstat (limited to 'lib/tools/emacs/erlang.el')
-rw-r--r--lib/tools/emacs/erlang.el29
1 files changed, 16 insertions, 13 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)))))
)))