From: Jakub Ječmínek Date: Wed, 21 Jun 2023 13:50:31 +0000 (+0200) Subject: Fix orgtbl-to-table.el function to include last cell border X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4c01b0deee13808605b05a89e927e67eaf67edbd;p=emacs.git Fix orgtbl-to-table.el function to include last cell border * lisp/org/org-table.el (orgtbl-to-table.el): Perform character replacement in the temp buffer and fix missing cell border. (Bug#64205) Copyright-paperwork-exempt: yes --- diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 42f234790c5..9a72eb5f314 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -6132,9 +6132,13 @@ supported." (with-temp-buffer (insert (orgtbl-to-orgtbl table params)) (org-table-align) - (replace-regexp-in-string - "-|" "-+" - (replace-regexp-in-string "|-" "+-" (buffer-substring 1 (buffer-size)))))) + (goto-char (point-min)) + (while (search-forward "-|" nil t) + (replace-match "-+")) + (goto-char (point-min)) + (while (search-forward "|-" nil t) + (replace-match "+-")) + (buffer-string))) (defun orgtbl-to-unicode (table params) "Convert the `orgtbl-mode' TABLE into a table with unicode characters.