summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArash Esbati <arash@gnu.org>2026-03-31 21:13:33 +0200
committerArash Esbati <arash@gnu.org>2026-03-31 21:13:33 +0200
commit4dc9c8cc1d3672479665923bd0ae807839d3a64c (patch)
treebf5a006e3df7625cbed1aeb04bf20396516aeb3f
parentf0f80f5bfd678fbd58cfeb8e8db472e442b69522 (diff)
Improve matching of header end/trailer start in ConTeXtexternals/auctex
* context.el (ConTeXt-header-end): Add other macro names marking the header end. Add regexp to match additional arguments. (ConTeXt-trailer-start): Add other macro names marking the trailer start. Issue reported by Jim Diamond <zlists+auctex@jdvb.ca>: https://lists.gnu.org/archive/html/auctex/2026-03/msg00010.html
-rw-r--r--context.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/context.el b/context.el
index 64f1179..a154bbc 100644
--- a/context.el
+++ b/context.el
@@ -1,6 +1,6 @@
;;; context.el --- Support for ConTeXt documents. -*- lexical-binding: t; -*-
-;; Copyright (C) 2003-2025 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2026 Free Software Foundation, Inc.
;; Author: Patrick Gundlach <pg@levana.de>
;; Berend de Boer <berend@pobox.com>
@@ -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."