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 ;-)  Can you please test the case
above with this patch and see if you get good results?  TIA.

--8<---------------cut here---------------start------------->8---
diff --git a/context.el b/context.el
index 64f1179a..7df2f138 100644
--- a/context.el
+++ b/context.el
@@ -1257,14 +1257,18 @@ header is at the start of a line."
   (concat
    (regexp-quote TeX-esc)
    (ConTeXt-environment-start-name)
-   ConTeXt-text))
+   (regexp-opt `( ,ConTeXt-text "component" "document" "MPpage"
+                  "product" "TEXpage"))
+   ;; Allow one level of argument inside braces
+   "\\(?:[ \t]*\\(?:\\[[^][]*?\\(?:{[^}{]*}[^][]*\\)*\\]\\)?\\|.*$\\)"))

 (defun ConTeXt-trailer-start ()
   "Default start of trailer marker for ConTeXt documents."
   (concat
    (regexp-quote TeX-esc)
    (ConTeXt-environment-stop-name)
-   ConTeXt-text))
+   (regexp-opt `( ,ConTeXt-text "component" "document" "MPpage"
+                  "product" "TEXpage"))))

 (defun ConTeXt-outline-offset ()
   "Offset to add to `ConTeXt-section-list' levels to get outline level."
--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.

Best, Arash

Reply via email to