소스 검색

table: Small fix

* lisp/org-table.el (org-table-to-lisp): Make sure to stop at the end
of the table.
Nicolas Goaziou 4 년 전
부모
커밋
e955976983
1개의 변경된 파일6개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 7
      lisp/org-table.el

+ 6 - 7
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)))))