forked from mirrors/org-mode
Merge branch 'maint'
This commit is contained in:
commit
419b69a435
40
lisp/ox.el
40
lisp/ox.el
|
@ -4481,26 +4481,26 @@ same column as TABLE-CELL, or nil."
|
||||||
(plist-put info :table-cell-width-cache
|
(plist-put info :table-cell-width-cache
|
||||||
(make-hash-table :test 'equal)))
|
(make-hash-table :test 'equal)))
|
||||||
:table-cell-width-cache)))
|
:table-cell-width-cache)))
|
||||||
(key (cons table column)))
|
(key (cons table column))
|
||||||
(or (let ((cached (gethash key cache 'no-result)))
|
(value (gethash key cache 'no-result)))
|
||||||
(and (not (eq cached 'no-result)) cached))
|
(if (not (eq value 'no-result)) value
|
||||||
(let (cookie-width)
|
(let (cookie-width)
|
||||||
(dolist (row (org-element-contents table)
|
(dolist (row (org-element-contents table)
|
||||||
(puthash key cookie-width cache))
|
(puthash key cookie-width cache))
|
||||||
(when (org-export-table-row-is-special-p row info)
|
(when (org-export-table-row-is-special-p row info)
|
||||||
;; In a special row, try to find a width cookie at COLUMN.
|
;; In a special row, try to find a width cookie at COLUMN.
|
||||||
(let* ((value (org-element-contents
|
(let* ((value (org-element-contents
|
||||||
(elt (org-element-contents row) column)))
|
(elt (org-element-contents row) column)))
|
||||||
(cookie (car value)))
|
(cookie (car value)))
|
||||||
;; The following checks avoid expanding unnecessarily the
|
;; The following checks avoid expanding unnecessarily
|
||||||
;; cell with `org-export-data'
|
;; the cell with `org-export-data'.
|
||||||
(when (and value
|
(when (and value
|
||||||
(not (cdr value))
|
(not (cdr value))
|
||||||
(stringp cookie)
|
(stringp cookie)
|
||||||
(string-match "\\`<[lrc]?\\([0-9]+\\)?>\\'" cookie)
|
(string-match "\\`<[lrc]?\\([0-9]+\\)?>\\'" cookie)
|
||||||
(match-string 1 cookie))
|
(match-string 1 cookie))
|
||||||
(setq cookie-width
|
(setq cookie-width
|
||||||
(string-to-number (match-string 1 cookie)))))))))))
|
(string-to-number (match-string 1 cookie)))))))))))
|
||||||
|
|
||||||
(defun org-export-table-cell-alignment (table-cell info)
|
(defun org-export-table-cell-alignment (table-cell info)
|
||||||
"Return TABLE-CELL contents alignment.
|
"Return TABLE-CELL contents alignment.
|
||||||
|
|
Loading…
Reference in a new issue