diff --git a/lisp/ox.el b/lisp/ox.el index d0ccc1e6f..12a747543 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2250,9 +2250,10 @@ recursively convert DATA using BACKEND translation table." ;; memoization. (org-combine-plists info - (list :translate-alist (org-export-get-all-transcoders backend) + (list :back-end backend + :translate-alist (org-export-get-all-transcoders backend) ;; Size of the hash table is reduced since this function - ;; will probably be used on short trees. + ;; will probably be used on small trees. :exported-data (make-hash-table :test 'eq :size 401))))) (defun org-export--interpret-p (blob info) @@ -2754,7 +2755,8 @@ VALUE is ignored. Call is done in a LIFO fashion, to be sure that developer specified filters, if any, are called first." (catch 'exit - (let ((backend-name (org-export-backend-name (plist-get info :back-end)))) + (let* ((backend (plist-get info :back-end)) + (backend-name (and backend (org-export-backend-name backend)))) (dolist (filter filters value) (let ((result (funcall filter value backend-name info))) (cond ((not result) value) diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index abe980c62..289cf075a 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -2246,51 +2246,48 @@ Another text. (ref:text) (ert-deftest test-org-export/table-cell-alignment () "Test `org-export-table-cell-alignment' specifications." - (let ((org-table-number-fraction 0.5) - (org-table-number-regexp "^[0-9]+$")) - ;; 1. Alignment is primarily determined by alignment cookies. - (org-test-with-temp-text "| | | |" - (let* ((tree (org-element-parse-buffer)) - (info `(:parse-tree ,tree))) - (should - (equal - '(left center right) - (mapcar (lambda (cell) (org-export-table-cell-alignment cell info)) - (org-element-map tree 'table-cell 'identity)))))) - ;; 2. The last alignment cookie has precedence. - (org-test-with-parsed-data " + ;; 1. Alignment is primarily determined by alignment cookies. + (should + (equal '(left center right) + (let ((org-table-number-fraction 0.5) + (org-table-number-regexp "^[0-9]+$")) + (org-test-with-parsed-data "| | | |" + (mapcar (lambda (cell) + (org-export-table-cell-alignment cell info)) + (org-element-map tree 'table-cell 'identity)))))) + ;; 2. The last alignment cookie has precedence. + (should + (equal '(right right right) + (org-test-with-parsed-data " | | | cell | | |" - (should - (equal - '(right right right) - (mapcar (lambda (cell) (org-export-table-cell-alignment cell info)) - (org-element-map tree 'table-cell 'identity))))) - ;; 3. If there's no cookie, cell's contents determine alignment. - ;; A column mostly made of cells containing numbers will align - ;; its cells to the right. - (org-test-with-parsed-data " + (mapcar (lambda (cell) (org-export-table-cell-alignment cell info)) + (org-element-map tree 'table-cell 'identity))))) + ;; 3. If there's no cookie, cell's contents determine alignment. + ;; A column mostly made of cells containing numbers will align + ;; its cells to the right. + (should + (equal '(right right right) + (let ((org-table-number-fraction 0.5) + (org-table-number-regexp "^[0-9]+$")) + (org-test-with-parsed-data " | 123 | | some text | | 12345 |" - (should - (equal - '(right right right) - (mapcar (lambda (cell) - (org-export-table-cell-alignment cell info)) - (org-element-map tree 'table-cell 'identity))))) - ;; 4. Otherwise, they will be aligned to the left. - (org-test-with-parsed-data " + (mapcar (lambda (cell) + (org-export-table-cell-alignment cell info)) + (org-element-map tree 'table-cell 'identity)))))) + ;; 4. Otherwise, they will be aligned to the left. + (should + (equal '(left left left) + (org-test-with-parsed-data " | text | | some text | | \alpha |" - (should - (equal - '(left left left) - (mapcar (lambda (cell) - (org-export-table-cell-alignment cell info)) - (org-element-map tree 'table-cell 'identity))))))) + (mapcar (lambda (cell) + (org-export-table-cell-alignment cell info)) + (org-element-map tree 'table-cell 'identity info)))))) (ert-deftest test-org-export/table-cell-borders () "Test `org-export-table-cell-borders' specifications."