emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4c01b0deee1: Fix orgtbl-to-table.el function to include last cell


From: Robert Pluim
Subject: master 4c01b0deee1: Fix orgtbl-to-table.el function to include last cell border
Date: Thu, 22 Jun 2023 11:41:32 -0400 (EDT)

branch: master
commit 4c01b0deee13808605b05a89e927e67eaf67edbd
Author: Jakub Ječmínek <jecminek.k@gmail.com>
Commit: Robert Pluim <rpluim@gmail.com>

    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
---
 lisp/org/org-table.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]