table: `org-table-to-lisp' does not check if point is at a table

* lisp/org-table.el (org-table-to-lisp): Do not check if point is at
a table.  Leave it to the caller.

See <http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00000.html>.
This commit is contained in:
Nicolas Goaziou 2020-05-01 15:00:47 +02:00
parent e955976983
commit ce10179cc2
2 changed files with 7 additions and 1 deletions

View File

@ -324,6 +324,12 @@ From ~org-enable-priority-commands~ to ~org-priority-enable-commands~.
From ~org-show-priority~ to ~org-priority-show~.
** Miscellaneous
*** ~org-table-to-lisp~ no longer checks if point is at a table
The caller is now responsible for the check. It can use, e.g.,
~org-at-table-p~.
The function is also much more efficient than it used to, even on very
large tables.
*** New function : ~org-collect-keywords~
*** Drawers' folding use an API similar to block's

View File

@ -5463,6 +5463,7 @@ a radio table."
;;;###autoload
(defun org-table-to-lisp (&optional txt)
"Convert the table at point to a Lisp structure.
The structure will be a list. Each item is either the symbol `hline'
for a horizontal separator line, or a list of field values as strings.
The table is taken from the parameter TXT, or from the buffer at point."
@ -5471,7 +5472,6 @@ The table is taken from the parameter TXT, or from the buffer at point."
(insert txt)
(goto-char (point-min))
(org-table-to-lisp))
(unless (org-at-table-p) (user-error "No table at point"))
(save-excursion
(goto-char (org-table-begin))
(let ((table nil))