On Mon, Mar 30, 2026 at 13:01 (+0200), Arash Esbati wrote:

> Jim <[email protected]> writes:

>>>> (I didn't try with
>>>>         \startcomponent [title={This has a ] of all things},
>>>> otherstuff]

>>> The above will break, I know.

>> And I think it is such a pathological case that it doesn't deserve a
>> lot of concern.

> We try to look after all kind of use cases ;-)

That is a good principle... but one should not descend into misery trying
to do that.  The regexp
     "\\(?:[ \t]*\\(?:\\[[^][]*?\\(?:{[^}{]*}[^][]*\\)*\\]\\)?\\|.*$\\)"
looks like the sort of thing that could bring on a migraine headache.  :-)

> Can you please test the case above with this patch and see if you get
> good results?

I do get good results with the tests I ran.

As it turns out, I was mixing up commands a bit: \startcomponent can't take
a \title, but I did check with
        \startdocument [metadata:author={fun and ] games}]
(this metadata gets put in the PDF), and I checked that the author field in
the metadata is exactly what I might hope.

So I think your suggestions for ConTeXt-header-end and
ConTeXt-trailer-start are good, and if your offer to push them into git is
still on offer, please go ahead and do so.

> --8<---------------cut here---------------start------------->8---
<snip>
> --8<---------------cut here---------------end--------------->8---


>> I have not seen any case where a \stopFOO takes an argument, so I
>> believe you are right.

> Thanks for confirming.

You're welcome.


Now that the regexp seems to handle the ConTeXt structure, the trickier
question of what the right thing to do with C-c C-b (and maybe, to a lesser
degree, C-c C-r) comes up.  I will reply to Ikumi's message and add a
couple of thoughts and a question or two.

                                Jim

Reply via email to