Browse Source

table: Speed-up for `org-table-align'

* lisp/org-table.el (org-table-align): Use `org-table-to-lisp'.

Suggested-by: Thierry Banel <tbanelwebmin@free.fr>
Nicolas Goaziou 2 months ago
parent
commit
13195a4a5f
1 changed files with 2 additions and 5 deletions
  1. 2 5
      lisp/org-table.el

+ 2 - 5
lisp/org-table.el

@@ -4349,11 +4349,8 @@ FIELD is a string.  WIDTH is a number.  ALIGN is either \"c\",
       (let* ((indent (progn (looking-at "[ \t]*") (match-string 0)))
 	     ;; Table's rows as lists of fields.  Rules are replaced
 	     ;; by nil.  Trailing spaces are removed.
-	     (fields (mapcar
-		      (lambda (l)
-			(and (not (string-match-p org-table-hline-regexp l))
-			     (org-split-string l "[ \t]*|[ \t]*")))
-		      (split-string (buffer-substring beg end) "\n" t)))
+	     (fields (mapcar (lambda (row) (and (listp row) row))
+			     (org-table-to-lisp)))
 	     ;; Compute number of columns.  If the table contains no
 	     ;; field, create a default table and bail out.
 	     (columns-number