unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64205: Fix missing border cell when using orgtbl-to-table.el function
@ 2023-06-20 21:57 Jakub Ječmínek
  2023-06-21 12:45 ` Robert Pluim
  2023-06-21 14:08 ` bug#64205: Fix missing cell border " Jakub Ječmínek
  0 siblings, 2 replies; 8+ messages in thread
From: Jakub Ječmínek @ 2023-06-20 21:57 UTC (permalink / raw)
  To: 64205


[-- Attachment #1.1: Type: text/plain, Size: 980 bytes --]

Hello,
I would like to take this opportunity to express my deep appreciation for
the valuable work the Emacs community has contributed to the development
and maintenance of this remarkable editor.

I've found a bug in the `orgtbl-to-table.el' function. When using
`orgtbl-to-table.el' during `org-table-export', last border cell ("|") was
omitted in the output.

Steps to reproduce:

(require 'org-table)
(insert "\n" (orgtbl-to-table.el '(("first colum" "second column") hline
("12" "34")) nil))

Previous implementation output:

| first colum | second column |
+--------------+---------------------+
|          12     |            34           < missing border cell

Current output:

| first colum | second column |
+--------------+---------------------+
|          12    |             34          |


In attachment, you'll find the smallest patch you've ever seen.

Thank you for everything you do for my beloved Emacs.

Best, Jakub Ječmínek

[-- Attachment #1.2: Type: text/html, Size: 1401 bytes --]

[-- Attachment #2: 0001-Fix-orgtbl-to-table.el-function-to-include-last-cell.patch --]
[-- Type: application/octet-stream, Size: 987 bytes --]

From 688bd0104f1e63df8f757de825481a69c4620f81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Je=C4=8Dm=C3=ADnek?= <jecminek.k@gmail.com>
Date: Tue, 20 Jun 2023 23:30:49 +0200
Subject: [PATCH] Fix orgtbl-to-table.el function to include last cell border

Previously used buffer-size function is (1- (point-max)) which means
that last cell border was omitted.
---
 lisp/org/org-table.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 42f234790c5..9d3507e34b7 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -6134,7 +6134,7 @@ supported."
     (org-table-align)
     (replace-regexp-in-string
      "-|" "-+"
-     (replace-regexp-in-string "|-" "+-" (buffer-substring 1 (buffer-size))))))
+     (replace-regexp-in-string "|-" "+-" (buffer-substring 1 (point-max))))))
 
 (defun orgtbl-to-unicode (table params)
   "Convert the `orgtbl-mode' TABLE into a table with unicode characters.
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-22 15:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-20 21:57 bug#64205: Fix missing border cell when using orgtbl-to-table.el function Jakub Ječmínek
2023-06-21 12:45 ` Robert Pluim
2023-06-21 14:08 ` bug#64205: Fix missing cell border " Jakub Ječmínek
2023-06-21 15:24   ` Robert Pluim
2023-06-21 15:42     ` Jakub Ječmínek
     [not found]       ` <CAFBiodLYe+98=dYnvYCqxW0yY1feR8t_OKEH9VLUYXvLRXpEAA@mail.gmail.com>
2023-06-22 14:38         ` Robert Pluim
2023-06-22 15:15           ` Eli Zaretskii
2023-06-22 15:43             ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).