Browse Source

org: Fix: Respect TAB in property drawer as separator

* lisp/org.el (org-property-drawer-re): Allow TAB as first
character after the property name's colon.
Marco Wahl 3 years ago
parent
commit
d0b55739c0
2 changed files with 5 additions and 1 deletions
  1. 1 1
      lisp/org.el
  2. 4 0
      testing/lisp/test-org.el

+ 1 - 1
lisp/org.el

@@ -565,7 +565,7 @@ Group 1 contains drawer's name or \"END\".")
 
 (defconst org-property-drawer-re
   (concat "^[ \t]*:PROPERTIES:[ \t]*\n"
-	  "\\(?:[ \t]*:\\S-+:\\(?: .*\\)?[ \t]*\n\\)*?"
+	  "\\(?:[ \t]*:\\S-+:\\(?:[ \t].*\\)?[ \t]*\n\\)*?"
 	  "[ \t]*:END:[ \t]*$")
   "Matches an entire property drawer.")
 

+ 4 - 0
testing/lisp/test-org.el

@@ -413,6 +413,10 @@
   ;; The function ignores incomplete drawers.
   (should-not
    (org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n"
+                            (org-at-property-drawer-p)))
+  ;; tab separating the value.
+  (should
+   (org-test-with-temp-text ":PROPERTIES:\n:PROP:	t\n:END:\n"
      (org-at-property-drawer-p))))
 
 (ert-deftest test-org/get-property-block ()