org-export--set-variables: Fix variable assignment
* lisp/ox.el (org-export--set-variables): Assume that variables are listed as (var value) - as a list. Only use the second element of the list as the value, following example in `org-export-get-environment'. (org-export-get-environment): Use `org-export--set-variables'. * testing/lisp/test-ox.el (test-org-export/bind-keyword): Add new test. Reported-by: Suhail Singh <suhailsingh247@gmail.com> Link: https://orgmode.org/list/87cyonhuq3.fsf@gmail.com
This commit is contained in:
parent
a13d8fe83b
commit
96113f3b59
|
@ -1398,8 +1398,7 @@ external parameters overriding Org default settings, but still
|
|||
inferior to file-local settings."
|
||||
;; First install #+BIND variables since these must be set before
|
||||
;; global options are read.
|
||||
(dolist (pair (org-export--list-bound-variables))
|
||||
(set (make-local-variable (car pair)) (nth 1 pair)))
|
||||
(org-export--set-variables (org-export--list-bound-variables))
|
||||
;; Get and prioritize export options...
|
||||
(org-combine-plists
|
||||
;; ... from global variables...
|
||||
|
@ -2585,7 +2584,7 @@ Return the updated communication channel."
|
|||
(defun org-export--set-variables (variable-alist)
|
||||
"Set buffer-local variables according to VARIABLE-ALIST in current buffer."
|
||||
(pcase-dolist (`(,var . ,val) variable-alist)
|
||||
(set (make-local-variable var) val)))
|
||||
(set (make-local-variable var) (car val))))
|
||||
|
||||
(cl-defun org-export-copy-buffer (&key to-buffer drop-visibility
|
||||
drop-narrowing drop-contents
|
||||
|
|
|
@ -133,7 +133,18 @@ variable, and communication channel under `info'."
|
|||
(org-export-create-backend
|
||||
:transcoders
|
||||
'((section . (lambda (s c i)
|
||||
(if (eq test-ox-var 'value) "Yes" "No")))))))))))
|
||||
(if (eq test-ox-var 'value) "Yes" "No"))))))))))
|
||||
;; Seen from elisp code blocks as well.
|
||||
(should
|
||||
(string-match-p "::: \"test value\""
|
||||
(org-test-with-temp-text "#+BIND: test-ox-var \"test value\"
|
||||
|
||||
#+begin_src emacs-lisp :results value :exports results :eval yes
|
||||
(format \"::: %S\" test-ox-var)
|
||||
#+end_src"
|
||||
(let ((org-export-allow-bind-keywords t))
|
||||
(org-export-as
|
||||
(org-test-default-backend)))))))
|
||||
|
||||
(ert-deftest test-org-export/parse-option-keyword ()
|
||||
"Test reading all standard #+OPTIONS: items."
|
||||
|
|
Loading…
Reference in New Issue