Explorar el Código

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>.
Nicolas Goaziou hace 4 años
padre
commit
ce10179cc2
Se han modificado 2 ficheros con 7 adiciones y 1 borrados
  1. 6 0
      etc/ORG-NEWS
  2. 1 1
      lisp/org-table.el

+ 6 - 0
etc/ORG-NEWS

@@ -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
 

+ 1 - 1
lisp/org-table.el

@@ -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))