aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2018-08-16 13:34:26 +0200
committerDan Gudmundsson <[email protected]>2018-08-16 13:34:26 +0200
commitfc99e2824d418dd9feb2f7f3382ae87bcc307792 (patch)
treea7b617814c67681e638b9d54ae9124be28b15e3e /lib/tools
parentcb3eeadcc9c5f1e8b2a7790df83f8ea3d995c964 (diff)
parent0d5c75394b24aedbae8bd707f9602386a2e992a3 (diff)
downloadotp-fc99e2824d418dd9feb2f7f3382ae87bcc307792.tar.gz
otp-fc99e2824d418dd9feb2f7f3382ae87bcc307792.tar.bz2
otp-fc99e2824d418dd9feb2f7f3382ae87bcc307792.zip
Merge remote-tracking branch 'upstream/maint'
* upstream/maint: Require align Add Erlang alignment regexps
Diffstat (limited to 'lib/tools')
-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)))