[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/caml 333d2f4 191/197: Improve syntax highlighting
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/caml 333d2f4 191/197: Improve syntax highlighting |
Date: |
Sat, 21 Nov 2020 01:20:05 -0500 (EST) |
branch: externals/caml
commit 333d2f4a1c624ab0cf0547404cde5c9e2a472012
Merge: adafe8a 5569e23
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Improve syntax highlighting
The change to caml-font-other-comment-re is motivated by the following:
Otherwise in (* f' '"' *) the f will be matched as
caml-font-other-comment-re, then ' ' as a character, and the rest as
an unclosed string. With this change, f' is matched as
caml-font-ident-re and '"' as a character.
---
caml-font.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/caml-font.el b/caml-font.el
index a282995..3a534ff 100644
--- a/caml-font.el
+++ b/caml-font.el
@@ -160,7 +160,7 @@
; match any char token
(defconst caml-font-char-re
(concat "'\\(\015\012\\|[^\\']\\|"
- "\\(\\\\\\([\\'\"ntbr ]\\|[0-9][0-9][0-9]"
+ "\\(\\\\\\([\\'\"ntbr ]\\|[0-9][0-9][0-9]\\|o[0-3][0-7][0-7]"
"\\|x[0-9A-Fa-f][0-9A-Fa-f]\\)\\)\\)'")
)
@@ -184,7 +184,7 @@
; match any sequence of non-special characters in a comment
; note: this is only to go faster than one character at a time
(defconst caml-font-other-comment-re
- "[^{(*\"'\012\015]+"
+ "[^A-Za-z_\300-\326\330-\366\370-\377{(*\"'\012\015]+"
)
; match any sequence of non-special characters in a string
@@ -299,6 +299,8 @@
((looking-at caml-font-newline-re)
(goto-char (match-end 0))
(setq continue (caml-font-put-state (match-end 0) (cons nil depth))))
+ ((caml-font-looking-at caml-font-ident-re)
+ (goto-char (match-end 0)))
((caml-font-looking-at caml-font-other-comment-re)
(goto-char (match-end 0)))
(t
- [nongnu] externals/caml a913400 175/197: elisp: cosmetic docstring tweaks, (continued)
- [nongnu] externals/caml a913400 175/197: elisp: cosmetic docstring tweaks, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml c0bf206 169/197: Follow Emacs Lisp conventions for caml.el (#1346), Stefan Monnier, 2020/11/21
- [nongnu] externals/caml f49a296 164/197: caml-types.el: Extract the feedback logic to a separate function., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 4c414a0 180/197: Emacs: Improve colors on dark themes, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 07d301a 174/197: elisp: fixed grammar in docstrings and comments, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 2964c4d 162/197: Add another format to parse compiler output., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 02f8809 184/197: Emacs: use symbol boundaries in regular expressions, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 4c8c8d3 176/197: makefiles: use 'install' instead of 'cp' in 'make install' targets, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml c9e7f57 186/197: Fix most CheckDoc errors., Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 78ec6be 185/197: Transform the README to Markdown, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 333d2f4 191/197: Improve syntax highlighting,
Stefan Monnier <=
- [nongnu] externals/caml adafe8a 190/197: Add OPAM file, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 466d703 194/197: Minor improvements to the README, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 1d6cd46 196/197: Add make target for opam release, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 38ebde1 197/197: Generate a caml-mode-site-file, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 29aaf70 193/197: Move the changelog to CHANGES, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml bfa612b 195/197: Mention easy ways of installing this package, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml b6eebe4 192/197: Apply some recommendations of checkdoc, Stefan Monnier, 2020/11/21
- [nongnu] externals/caml 9d5dbfb 131/197: - Replaced setq by add-to-list in README, Stefan Monnier, 2020/11/21