summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTEC <tec@tecosaur.com>2021-05-23 04:04:01 +0800
committerTEC <tec@tecosaur.com>2021-05-23 04:06:49 +0800
commitf72a658bd057e953a1cdb6f3230b8caae2560d80 (patch)
treefe227a9a3899e2ab9f81bb043127810f6f2a18a7
parent52b09799cfba0a847e93c9e21883266570644245 (diff)
downloadorg-mode-f72a658bd057e953a1cdb6f3230b8caae2560d80.tar.gz
org-plot: Use consistent method to find table
* lisp/org-plot.el (org-plot/gnuplot): Table information is obtained using (org-plot/goto-nearest-table), however it was not used when fetching data from the table. It is more sensible to use the same method. This also now allows a #+plot statement to be placed before a #+RESULTS line and a table.
-rw-r--r--lisp/org-plot.el4
1 files changed, 1 insertions, 3 deletions
diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 54c06d6..0e5032b 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -651,9 +651,7 @@ line directly before or after the table."
;; collect table and table information
(let* ((data-file (make-temp-file "org-plot"))
(table (let ((tbl (save-excursion
- ;; needed due to particularities of `org-table-begin'
- (when (= (current-column) 0)
- (forward-char 1))
+ (org-plot/goto-nearest-table)
(org-table-to-lisp))))
(when (pcase (plist-get params :transpose)
(`y t)