aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2018-08-16 13:19:42 +0200
committerGitHub <[email protected]>2018-08-16 13:19:42 +0200
commit0d5c75394b24aedbae8bd707f9602386a2e992a3 (patch)
treea879d6a0d1d84fa712ec6dc55e469663db519147
parent95188aed6498fad06a9a99644535e39d5b9804d3 (diff)
parent9794afec79798d139eeca3cde7d2c2a608dfff00 (diff)
downloadotp-0d5c75394b24aedbae8bd707f9602386a2e992a3.tar.gz
otp-0d5c75394b24aedbae8bd707f9602386a2e992a3.tar.bz2
otp-0d5c75394b24aedbae8bd707f9602386a2e992a3.zip
Merge pull request #1728 from davidw/emacs-align
OTP-15239
-rw-r--r--lib/tools/emacs/erlang.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index 3211132254..242a5abe72 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -77,6 +77,7 @@
;;; Code:
(eval-when-compile (require 'cl))
+(eval-when-compile (require 'align))
;; Variables:
@@ -1405,6 +1406,19 @@ Other commands:
(add-function :before-until (local 'eldoc-documentation-function)
#'erldoc-eldoc-function))
(run-hooks 'erlang-mode-hook)
+
+ ;; Align maps.
+ (add-to-list 'align-rules-list
+ '(erlang-maps
+ (regexp . "\\(\\s-*\\)\\(=>\\)\\s-*")
+ (modes . '(erlang-mode))
+ (repeat . t)))
+ ;; Align records and :: specs
+ (add-to-list 'align-rules-list
+ '(erlang-record-specs
+ (regexp . "\\(\\s-*\\)\\(=\\).*\\(::\\)*\\s-*")
+ (modes . '(erlang-mode))
+ (repeat . t)))
(if (zerop (buffer-size))
(run-hooks 'erlang-new-file-hook)))