Re: Syntax classes of text in href

2023-05-11 Thread Arash Esbati
Hi all, Al Haji-Ali writes: > Thanks! The fontification is indeed better, though a bit inconsistent > (nevertheless I think the behaviour is better for me personally, even > with the inconsistency). > > This command: > > \href{pre\cmd{test}post}{foo} > > has the correct character class for the

Re: Syntax classes of text in href

2023-02-27 Thread Abdul-Lateef Haji-Ali
Hello Arash, On 19/02/2023, Arash Esbati wrote: > Thanks for checking. Can you please elaborate what you mean the "a bit > inconsistent"? I'm not sure IIUC. Sorry, I meant the behaviour subsequent I described subsequently. > So the braces around the argument of \href have the syntax class

Re: Syntax classes of text in href

2023-02-19 Thread Arash Esbati
Hi All, Al Haji-Ali writes: > Thanks! The fontification is indeed better, though a bit inconsistent > (nevertheless I think the behaviour is better for me personally, even > with the inconsistency). Thanks for checking. Can you please elaborate what you mean the "a bit inconsistent"? I'm not

Re: Syntax classes of text in href

2023-02-18 Thread Al Haji-Ali
Hello Arash, > It still doesn't solve the issue Al has `rainbow-delimiters` (I guess), > but should unbreak the fontification and give somewhat better results. Thanks! The fontification is indeed better, though a bit inconsistent (nevertheless I think the behaviour is better for me

Re: Syntax classes of text in href

2023-02-18 Thread Arash Esbati
Ikumi Keita writes: >> Arash Esbati 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

Re: Syntax classes of text in href

2023-01-13 Thread Arash Esbati
Ikumi Keita writes: >> Arash Esbati 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... I

Re: Syntax classes of text in href

2023-01-13 Thread Arash Esbati
Abdul-Lateef Haji-Ali writes: > Nevertheless, IMO, treating a url as verbatim seems to be the main > issue since it clearly is not (e.g., macros are processed). This is LaTeX, there is always a package which does something (non-)special ;-) \documentclass{article} \usepackage{fvextra}

Re: Syntax classes of text in href

2023-01-13 Thread Ikumi Keita
Hi Arash and Al, > Arash Esbati writes: > Ikumi Keita writes: >> But maybe it's a corner case that we don't have to worry about. I'm not >> sure. > This is indeed a corner case: Packages like fvextra.sty which allow > things like \Verb{content} explicitly require balanced braces; >

Re: Syntax classes of text in href

2023-01-13 Thread Abdul-Lateef Haji-Ali
On 13/01/2023, Ikumi Keita wrote: > Hmm. That would fail if some verbatim macro has an intentional unpaired > "{" in its argument like \foobar{aaa"{"bbb} . > But maybe it's a corner case that we don't have to worry about. I'm not > sure. What do others think about this? I am not too familiar

Re: Syntax classes of text in href

2023-01-13 Thread Arash Esbati
Hi Keita, Ikumi Keita writes: >> How about this: First of all, my last patch wasn't correct, please try this one if you want to test: --8<---cut here---start->8--- diff --git a/font-latex.el b/font-latex.el index b78cf58a..0d32eab1 100644 ---

Re: Syntax classes of text in href

2023-01-13 Thread Ikumi Keita
Hi Arash, > Arash Esbati writes: >> I haven't updated my TeX Live 2022 installation yet, so maybe the latest >> version is revised in such a way? > Yes, this is the corresponding bug report: > https://github.com/latex3/hyperref/issues/249 Indeed, thanks. > How about this: > diff --git

Re: Syntax classes of text in href

2023-01-12 Thread Arash Esbati
Hi Keita, Ikumi Keita writes: >> Arash Esbati writes: >> >> Footnotes: >> [1] From hyperref.pdf, section 6 Additional user macros. > > Hmm, strange. The same portion of hyperref-doc.pdf (not hyperref.pdf, > though) reads Sorry, my bad, I meant hyperref-doc.pdf. > ... The special

Re: Syntax classes of text in href

2023-01-12 Thread Ikumi Keita
Hi Arash, > Arash Esbati writes: > I think the problem is this[1]: > \href[options]{URL}{text} > The text is made a hyperlink to the URL; this must be a full URL > (relative to the base URL, if that is defined). The special > characters # and % do _not_ need to be escaped in any

Re: Syntax classes of text in href

2023-01-12 Thread Arash Esbati
Hi Keita, Ikumi Keita writes: > Is it appropriate to treat the URL argument of \href as verbatim? > According to hyperdoc document, only "#" and "~" are special there. I think the problem is this[1]: \href[options]{URL}{text} The text is made a hyperlink to the URL; this must be a full

Re: Syntax classes of text in href

2023-01-12 Thread Ikumi Keita
Hi Arash and Al, > Arash Esbati writes: > Al Haji-Ali writes: >> On 11/01/2023, Arash Esbati wrote: >> >>> We can teach the code to accept one level of braces, but is there a real >>> use-case for it? >> Why only one level? Doesn't AUCTeX have code to balance braces somewhere? > This is

Re: Syntax classes of text in href

2023-01-11 Thread Al Haji-Ali
On 11/01/2023, Arash Esbati wrote: > Plonk this example in your .tex file and you'll see what's happening: > > \href{pre\cmd{test}post}{foo} Indeed, it's more broken that I thought. >> I can remove `\href` from `LaTeX-verbatim-macros-with-braces` and call >>

Re: Syntax classes of text in href

2023-01-11 Thread Arash Esbati
Al Haji-Ali writes: > If I have the following text in a LaTeX buffer: > > \href{ \cmd{test} } > > The opening brace of href has syntax class 15 (for generic > delimiter?), tested by calling `(syntax-after (point))`. While the > closing brace seems to have syntax class 5 (for closed > delimiter).

Syntax classes of text in href

2023-01-11 Thread Al Haji-Ali
If I have the following text in a LaTeX buffer: \href{ \cmd{test} } The opening brace of href has syntax class 15 (for generic delimiter?), tested by calling `(syntax-after (point))`. While the closing brace seems to have syntax class 5 (for closed delimiter). Strangely, the opening brace of