diff --git a/lisp/org.el b/lisp/org.el index 1ffea80fe..dac68db1c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16051,7 +16051,9 @@ COLUMN formats in the current buffer." (when (memq (org-element-type element) '(keyword node-property)) (let ((value (org-element-property :value element)) (start 0)) - (while (string-match "%[0-9]*\\(\\S-+\\)" value start) + (while (string-match "%[0-9]*\\([[:alnum:]_-]+\\)\\(([^)]+)\\)?\ +\\(?:{[^}]+}\\)?" + value start) (setq start (match-end 0)) (let ((p (match-string-no-properties 1 value))) (unless (member-ignore-case p org-special-properties) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index c3e7aa2d6..065d31f4d 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -4916,6 +4916,19 @@ Paragraph" (equal '("A" "B" "COLUMNS") (org-test-with-temp-text "* H\n:PROPERTIES:\n:COLUMNS: %25ITEM %A %20B\n:END:" + (org-buffer-property-keys nil nil t)))) + ;; In COLUMNS, ignore label title and summary-type. + (should + (equal '("A") + (org-test-with-temp-text "#+COLUMNS: %A(Foo)" + (org-buffer-property-keys nil nil t)))) + (should + (equal '("A") + (org-test-with-temp-text "#+COLUMNS: %A{Foo}" + (org-buffer-property-keys nil nil t)))) + (should + (equal '("A") + (org-test-with-temp-text "#+COLUMNS: %A(Foo){Bar}" (org-buffer-property-keys nil nil t))))) (ert-deftest test-org/property-values ()