branch: elpa/tuareg commit 50309aed6931d1e8c07369b4dc382ffaa6d4cd05 Author: Christophe Troestler <christophe.troest...@umons.ac.be> Commit: Christophe Troestler <christophe.troest...@umons.ac.be>
Enable to turn off the delimiters matching (show-paren) for comments --- CHANGES.md | 5 ++++- README.md | 3 +++ tuareg.el | 14 ++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6ce6faa..e4990e4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,10 @@ Note that <kbd>C-c C-c</kbd> launches the compilation. * `tuareg-jbuilder`: <kbd>C-c C-c</kbd> launches the compilation. * Be more subtle in phrase detection. -* Syntax highlighting improvements: faster; much better highlighting +* Bogus mismatched parentheses at the end of comment fixed. +* ⚠ `show-paren-mode`: also highlight comment delimiters. You can + turn that off by setting `tuareg-comment-show-paren` to `nil`. +* Syntax highlighting improvements: much faster; much better highlighting of function, class, and method arguments (including setting the `font-lock-multiline` property); `[]` and `::` have the constructor face; first class module, `type nonrec`, `raise_notrace`, `with diff --git a/README.md b/README.md index 2c269bc..c0651c7 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,9 @@ Tips & customization (setq-local comment-style 'multi-line) (setq-local comment-continue " "))) +- If you turn on `show-paren-mode`, the delimiters of comments will + also be highlighted. If you do not like this behavior, set + `tuareg-comment-show-paren` to `nil`. - Syntax highlighting has 3 levels. You can select the one you prefer by setting [font-lock-maximum-decoration][] from `0` to `2`. By diff --git a/tuareg.el b/tuareg.el index 396107e..6fde528 100644 --- a/tuareg.el +++ b/tuareg.el @@ -257,6 +257,11 @@ See `ff-other-file-alist'." :group 'tuareg :type '(repeat (list regexp (choice (repeat string) function)))) +(defcustom tuareg-comment-show-paren t + "Highlight comment delimiters in `show-paren-mode' if non-nil." + :group 'tuareg + :type 'boolean) + (defcustom tuareg-interactive-scroll-to-bottom-on-output nil "*Controls when to scroll to the bottom of the interactive buffer @@ -3120,8 +3125,6 @@ expansion at run-time, if the run-time version of Emacs does know this macro." (smie-setup tuareg-smie-grammar #'tuareg-smie-rules :forward-token #'tuareg-smie-forward-token :backward-token #'tuareg-smie-backward-token) - (add-function :around (local 'blink-matching-check-function) - #'tuareg--blink-matching-check) (tuareg--eval-when-macrop add-function (when (boundp 'smie--hanging-eolp-function) ;; FIXME: As its name implies, smie--hanging-eolp-function @@ -3132,8 +3135,11 @@ expansion at run-time, if the run-time version of Emacs does know this macro." (add-hook 'smie-indent-functions #'tuareg-smie--args nil t) (add-hook 'smie-indent-functions #'tuareg-smie--inside-string nil t) (setq-local add-log-current-defun-function #'tuareg-current-fun-name) - (add-function :around (local 'show-paren-data-function) - #'tuareg--show-paren) + (add-function :around (local 'blink-matching-check-function) + #'tuareg--blink-matching-check) + (when tuareg-comment-show-paren + (add-function :around (local 'show-paren-data-function) + #'tuareg--show-paren)) (setq prettify-symbols-alist (if tuareg-prettify-symbols-full (append tuareg-prettify-symbols-basic-alist