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>
This commit is contained in:
Kyle Meyer 2020-05-19 20:29:33 -04:00
parent 9bc0cc7fb3
commit 962b8e765c
2 changed files with 6 additions and 2 deletions

View File

@ -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)))

View File

@ -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."