[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Syntax classes of text in href
From: |
Arash Esbati |
Subject: |
Re: Syntax classes of text in href |
Date: |
Sat, 18 Feb 2023 15:39:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Ikumi Keita <ikumi@ikumi.que.jp> writes:
>>>>>> Arash Esbati <arash@gnu.org> writes:
>
>> \documentclass{article}
>> \usepackage{fvextra}
>
>> \begin{document}
>
>> \Verb{w{o}r{k}s}
>> \Verb{b{r}eak{s}}
>
>> \end{document}
>
>> due to "[^\\]\\(?:\\\\\\\\\\)*" in the regexp.
>
> Wow :-) That'd be hard to cope with cleanly...
After starring at it for some time, the best solution I could come up
with is this:
--8<---------------cut here---------------start------------->8---
diff --git a/font-latex.el b/font-latex.el
index b78cf58a..e9bce29c 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1095,8 +1095,14 @@ have changed."
;; Some macros take an optional argument. This is
;; the same line as above for environments.
"\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
- "\\({\\).*?[^\\]\\(?:\\\\\\\\\\)*\\(}\\)")
- (1 "|") (2 "|")))))
+ ;; "\\({\\).*?[^\\]\\(?:\\\\\\\\\\)*\\(}\\)"
+
+ "\\({\\)[^}{]*?"
+ "\\(?:{[^}{]*}[^}{]*?\\)*"
+ "\\(" (regexp-quote TeX-esc) "*\\)"
+ "\\(}\\)"
+ )
+ (1 "|") (2 ".") (3 "|")))))
(when font-latex-syntactic-keywords-extra
(nconc font-latex-syntactic-keywords font-latex-syntactic-keywords-extra))
;; ;; Cater for docTeX mode.
--8<---------------cut here---------------end--------------->8---
It still doesn't solve the issue Al has `rainbow-delimiters` (I guess),
but should unbreak the fontification and give somewhat better results.
@Al: Do you want to give it a roll?
Best, Arash
- Re: Syntax classes of text in href,
Arash Esbati <=