branch: externals/org commit 8f40da6bf6f2fea0b60592105fd05200d9f13603 Merge: a2ae069869 96113f3b59 Author: Ihor Radchenko <yanta...@posteo.net> Commit: Ihor Radchenko <yanta...@posteo.net>
Merge branch 'bugfix' --- lisp/ob-exp.el | 10 ++++++---- lisp/ox.el | 5 ++--- testing/lisp/test-ox.el | 13 ++++++++++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 657cb2b526..5516530c5b 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -265,8 +265,9 @@ this template." (if (not (eq type 'babel-call)) (progn (skip-chars-forward " \t") (point)) - (skip-chars-forward " \r\t\n") - (line-beginning-position))))) + (unless (eobp) + (skip-chars-forward " \r\t\n") + (line-beginning-position)))))) ((not rep) ;; Replacement code cannot be determined. ;; Leave the code block as is. @@ -291,8 +292,9 @@ this template." (cond ((not replacement) (goto-char end)) ((equal replacement "") (goto-char end) - (skip-chars-forward " \r\t\n") - (forward-line 0) + (unless (eobp) + (skip-chars-forward " \r\t\n") + (forward-line 0)) (delete-region begin (point))) (t (if (org-src-preserve-indentation-p element) diff --git a/lisp/ox.el b/lisp/ox.el index 1c52ca2905..29390bf0e4 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -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 diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index 9b1b900ca4..0a39ddf2db 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -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."