diff options
author | David N. Welton <[email protected]> | 2018-02-25 16:18:31 -0800 |
---|---|---|
committer | David N. Welton <[email protected]> | 2018-02-25 16:18:31 -0800 |
commit | 8d948cfaf990a92d58f9a6f9af0d7a8c38b7b8c2 (patch) | |
tree | 2908ba3229df81dfb22bb9f076ca073fe29c99ad /lib/tools | |
parent | ce7571e174a426fcb5c36e8d0757ae7ef481634e (diff) | |
download | otp-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')
-rw-r--r-- | lib/tools/emacs/erlang.el | 13 |
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))) |