From e95597698339e6e8e8734cd92ac63cd057b6d10c Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 1 May 2020 12:29:11 +0200 Subject: [PATCH] table: Small fix * lisp/org-table.el (org-table-to-lisp): Make sure to stop at the end of the table. --- lisp/org-table.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 2475d8561..735c3d732 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -5475,17 +5475,16 @@ The table is taken from the parameter TXT, or from the buffer at point." (save-excursion (goto-char (org-table-begin)) (let ((table nil)) - (while (search-forward "|" (line-end-position) t) + (while (re-search-forward "\\=[ \t]*|" nil t) (let ((row nil)) (if (looking-at "-") (push 'hline table) (while (not (progn (skip-chars-forward " \t") (eolp))) - (push - (buffer-substring-no-properties - (point) - (progn (re-search-forward "[ \t]*\\(|\\|$\\)") - (match-beginning 0))) - row)) + (push (buffer-substring-no-properties + (point) + (progn (re-search-forward "[ \t]*\\(|\\|$\\)") + (match-beginning 0))) + row)) (push (nreverse row) table))) (forward-line)) (nreverse table)))))