Bläddra i källkod

org.el: Fix regression in collecting empty-value keywords

* lisp/org.el (org--collect-keywords-1): Don't replace space-only
values with nil because that leads to the option's default being used.
* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options):
Add test.

This restores the behavior to what it was before b4e91b7e9 (New
function: org-collect-keywords, 2020-04-26).

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<CAFyQvY2ZGJPv=Ajx2_1xR0otv=VQYHcrUwzS46PmnyJ2Co1KVg@mail.gmail.com>
Kyle Meyer 4 år sedan
förälder
incheckning
962b8e765c
2 ändrade filer med 6 tillägg och 2 borttagningar
  1. 0 1
      lisp/org.el
  2. 6 1
      testing/lisp/test-ox.el

+ 0 - 1
lisp/org.el

@@ -4523,7 +4523,6 @@ directory."
 			  (push (cons keyword final) alist)
 			  (setq keywords (remove keyword keywords))
 			  (setq regexp (org-make-options-regexp keywords)))
-			 ((not (org-string-nw-p value)) nil)
 			 ((null entry) (push (list keyword final) alist))
 			 (t (push final (cdr entry)))))))))))
       alist)))

+ 6 - 1
testing/lisp/test-ox.el

@@ -280,7 +280,12 @@ num:2 <:active")))
   (should-not
    (equal "Mine"
 	  (org-test-with-parsed-data "* COMMENT H1\n** H2\n#+EMAIL: Mine"
-				     (plist-get info :email)))))
+				     (plist-get info :email))))
+  ;; Keywords can be set to an empty value.
+  (should-not
+   (let ((user-full-name "Me"))
+     (org-test-with-parsed-data "#+AUTHOR:"
+				(plist-get info :author)))))
 
 (ert-deftest test-org-export/get-subtree-options ()
   "Test setting options from headline's properties."