Browse Source

Fix typo

* lisp/org.el (org-at-property-drawer-p): Fix typo.
* testing/lisp/test-org.el (test-org/at-property-drawer-p): Update
name and function calls.  Add a test.
Nicolas Goaziou 1 month ago
parent
commit
ed0e75d241
2 changed files with 15 additions and 14 deletions
  1. 1 1
      lisp/org.el
  2. 14 13
      testing/lisp/test-org.el

+ 1 - 1
lisp/org.el

@@ -12474,7 +12474,7 @@ FORCE is non-nil, or return nil."
   "Non-nil when point is at the first line of a property drawer."
   (org-with-wide-buffer
    (beginning-of-line)
-   (and (looking-at org-property-start-re)
+   (and (looking-at org-property-drawer-re)
 	(or (bobp)
 	    (progn
 	      (forward-line -1)

+ 14 - 13
testing/lisp/test-org.el

@@ -397,22 +397,23 @@
 	  (org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n:END:\n"
 	    (org-at-property-p)))))
 
-(ert-deftest test-org/at-property-block-p ()
-  "Test `org-at-property-block-p' specifications."
+(ert-deftest test-org/at-property-drawer-p ()
+  "Test `org-at-property-drawer-p' specifications."
   (should
-   (equal 't
-	  (org-test-with-temp-text "* H\n<point>:PROPERTIES:\n:PROP: t\n:END:\n"
-	    (org-at-property-block-p))))
+   (org-test-with-temp-text "* H\n<point>:PROPERTIES:\n:PROP: t\n:END:\n"
+     (org-at-property-drawer-p)))
   (should
-   (equal 't
-	  (org-test-with-temp-text ":PROPERTIES:\n:PROP: t\n:END:\n"
-	    (org-at-property-block-p))))
-  ;; The function only returns t if point is at the first line of a
-  ;; property block.
+   (org-test-with-temp-text ":PROPERTIES:\n:PROP: t\n:END:\n"
+     (org-at-property-drawer-p)))
+  ;; The function only returns t if point is at the first line of
+  ;; a property block.
   (should-not
-   (equal 't
-	  (org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n:END:\n"
-	    (org-at-property-block-p)))))
+   (org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n:END:\n"
+     (org-at-property-drawer-p)))
+  ;; The function ignores incomplete drawers.
+  (should-not
+   (org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n"
+     (org-at-property-drawer-p))))
 
 (ert-deftest test-org/get-property-block ()
   "Test `org-get-property-block' specifications."