branch: elpa/tuareg commit f5906fa81aea7d930a8033f6a7ae51887dcc2068 Author: Demi Marie Obenour <d...@invisiblethingslab.com> Commit: GitHub <nore...@github.com>
Indent parenthesized if and match expressions properly This extends the approach used for `begin match ... end` to also cover `(match ... )` and `(if ...)`. --- tuareg.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tuareg.el b/tuareg.el index 4d199279e8..f38a445e16 100644 --- a/tuareg.el +++ b/tuareg.el @@ -2210,10 +2210,13 @@ Return values can be (and (not (smie-rule-bolp)) (cond ((smie-rule-prev-p "d=") (smie-rule-parent tuareg-default-indent)) - ((smie-rule-prev-p "begin") (smie-rule-parent))))) + ((or (smie-rule-prev-p "begin") (smi-rule-prev-p "(")) + (smie-rule-parent))))) ((equal token "then") (smie-rule-parent)) ((equal token "if") (if (and (not (smie-rule-bolp)) - (smie-rule-prev-p "else")) + (or (smie-rule-prev-p "else") + (smie-rule-prev-p "(") + (smie-rule-prev-p "begin"))) (smie-rule-parent))) ((and (equal token "with") (smie-rule-parent-p "{")) (smie-rule-parent))