From d98a49648066ce80f1193d36accb81253a4027df Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Fri, 21 Oct 2022 11:58:50 +0800 Subject: [PATCH] org-lint: Fix regexp when matching header-args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-lint.el (org-lint-wrong-header-argument): Correctly handle header-args:lang+ properties. Reported-by: Rudolf Adamkovič Link: https://orgmode.org/list/m2y1ta9rqe.fsf@me.com --- lisp/org-lint.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/org-lint.el b/lisp/org-lint.el index a9fe2b7e6..351f92b16 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -1066,8 +1066,10 @@ Use \"export %s\" instead" (`keyword (when (string= (org-element-property :key datum) "PROPERTY") (let ((value (org-element-property :value datum))) - (when (string-match "\\`header-args\\(?::\\(\\S-+\\)\\)?\\+? *" - value) + (when (or (string-match "\\`header-args\\(?::\\(\\S-+\\)\\)?\\+ *" + value) + (string-match "\\`header-args\\(?::\\(\\S-+\\)\\)? *" + value)) (funcall verify datum (match-string 1 value) @@ -1076,8 +1078,10 @@ Use \"export %s\" instead" (`node-property (let ((key (org-element-property :key datum))) (when (let ((case-fold-search t)) - (string-match "\\`HEADER-ARGS\\(?::\\(\\S-+\\)\\)?\\+?" - key)) + (or (string-match "\\`HEADER-ARGS\\(?::\\(\\S-+\\)\\)?\\+" + key) + (string-match "\\`HEADER-ARGS\\(?::\\(\\S-+\\)\\)?" + key))) (funcall verify datum (match-string 1 key)