|
5 | 5 |
|
6 | 6 | ;; Author: Ta Quang Trung <taquangtrungvn@gmail.com> |
7 | 7 | ;; Matus Goljer <matus.goljer@gmail.com> |
| 8 | +;; Louis Roché <louis@louisroche.net> |
8 | 9 | ;; Maintainer: Matus Goljer <matus.goljer@gmail.com> |
9 | 10 | ;; Created: 14 July 2016 |
10 | 11 | ;; Keywords: smartparens, ML, ocaml, reason |
|
50 | 51 | (require 'smartparens) |
51 | 52 |
|
52 | 53 | ;;; Local pairs for ML-family languages |
53 | | -(sp-with-modes '(tuareg-mode fsharp-mode) (sp-local-pair "(*" "*)" )) |
54 | | -(sp-with-modes '(reason-mode) (sp-local-pair "/*" "*/" )) |
| 54 | + |
| 55 | +(sp-with-modes '(fsharp-mode) |
| 56 | + (sp-local-pair "(*" "*)" )) |
| 57 | + |
| 58 | +;; all the keywords pairs are expanded only if followed by "SPC" |
| 59 | +;; event. This will reduce false positives like 'dIFficult' to |
| 60 | +;; trigger. |
| 61 | +(sp-with-modes '(tuareg-mode) |
| 62 | + ;; Disable ` because it is used in polymorphic variants |
| 63 | + (sp-local-pair "`" nil :actions nil) |
| 64 | + (sp-local-pair "(*" "*)" ) |
| 65 | + (sp-local-pair "if" "then" |
| 66 | + :when '(("SPC")) |
| 67 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 68 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 69 | + (sp-local-pair "while" "done" |
| 70 | + :when '(("SPC")) |
| 71 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 72 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 73 | + (sp-local-pair "for" "done" |
| 74 | + :when '(("SPC")) |
| 75 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 76 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 77 | + (sp-local-pair "begin" "end" |
| 78 | + :when '(("SPC")) |
| 79 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 80 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 81 | + (sp-local-pair "struct" "end" |
| 82 | + :when '(("SPC")) |
| 83 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 84 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 85 | + (sp-local-pair "sig" "end" |
| 86 | + :when '(("SPC")) |
| 87 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 88 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 89 | + (sp-local-pair "object" "end" |
| 90 | + :when '(("SPC")) |
| 91 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 92 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 93 | + (sp-local-pair "match" "with" |
| 94 | + :when '(("SPC")) |
| 95 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 96 | + :post-handlers '(sp-latex-insert-spaces-inside-pair)) |
| 97 | + (sp-local-pair "try" "with" |
| 98 | + :when '(("SPC")) |
| 99 | + :unless '(sp-in-comment-p sp-in-string-p) |
| 100 | + :post-handlers '(sp-latex-insert-spaces-inside-pair))) |
| 101 | + |
| 102 | +(sp-with-modes '(reason-mode) |
| 103 | + ;; Disable ` because it is used in polymorphic variants |
| 104 | + (sp-local-pair "`" nil :actions nil) |
| 105 | + (sp-local-pair "/*" "*/" )) |
55 | 106 |
|
56 | 107 | (provide 'smartparens-ml) |
57 | 108 | ;;; smartparens-ml.el ends here |
0 commit comments