mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 00:02:51 +00:00
org-table-to-lisp: Preserve text properties
* lisp/org-table.el (org-table-to-lisp): When parsing table, keep text properties. These text properties are required to calculate table alignment with invisible text. * testing/lisp/test-org-table.el (test-org-table/align): Add new test. Reported-by: Kostadin Ninev <dinkonin@gmail.com> Link: https://orgmode.org/list/1709041784097.2987395179.620232376@gmail.com
This commit is contained in:
parent
c841be9656
commit
731d16f9e9
|
@ -5519,7 +5519,9 @@ The table is taken from the parameter TXT, or from the buffer at point."
|
|||
(unless (eolp) (setq p (1+ p)))
|
||||
p)
|
||||
(skip-chars-backward " \t" q)
|
||||
(push (buffer-substring-no-properties q (point)) row)))))
|
||||
;; Preserve text properties. They are used when
|
||||
;; calculating cell width.
|
||||
(push (buffer-substring q (point)) row)))))
|
||||
(nreverse row)))
|
||||
table)
|
||||
(forward-line))
|
||||
|
|
|
@ -1849,7 +1849,21 @@ See also `test-org-table/copy-field'."
|
|||
(should
|
||||
(org-test-with-temp-text "|-<point>--|---------|\n|---|---|-----|"
|
||||
(org-table-align)
|
||||
t)))
|
||||
t))
|
||||
;; Adjust table width.
|
||||
(should
|
||||
(equal
|
||||
(let ((org-link-descriptive t))
|
||||
(org-test-with-temp-text "
|
||||
| a | b |
|
||||
|----------+---|
|
||||
| [[c][c]] | d |<point>"
|
||||
(org-table-align)
|
||||
(buffer-string)))
|
||||
"
|
||||
| a | b |
|
||||
|---+---|
|
||||
| [[c][c]] | d |")))
|
||||
|
||||
(ert-deftest test-org-table/align-buffer-tables ()
|
||||
"Align all tables when updating buffer."
|
||||
|
|
Loading…
Reference in a new issue