aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/emacs
diff options
context:
space:
mode:
authorDavid N. Welton <[email protected]>2018-02-25 16:18:31 -0800
committerDavid N. Welton <[email protected]>2018-02-25 16:18:31 -0800
commit8d948cfaf990a92d58f9a6f9af0d7a8c38b7b8c2 (patch)
tree2908ba3229df81dfb22bb9f076ca073fe29c99ad /lib/tools/emacs
parentce7571e174a426fcb5c36e8d0757ae7ef481634e (diff)
downloadotp-8d948cfaf990a92d58f9a6f9af0d7a8c38b7b8c2.tar.gz
otp-8d948cfaf990a92d58f9a6f9af0d7a8c38b7b8c2.tar.bz2
otp-8d948cfaf990a92d58f9a6f9af0d7a8c38b7b8c2.zip
Add Erlang alignment regexps
These allow for the alignment of maps and records
Diffstat (limited to 'lib/tools/emacs')
-rw-r--r--lib/tools/emacs/erlang.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index 411e0e13df..b757371483 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -1407,6 +1407,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)))