branch: externals/org commit 2ae308342a2daaac2394e4dd94b423d61dbc520c Author: TEC <t...@tecosaur.com> Commit: TEC <t...@tecosaur.com>
org-plot: Fix calling at start of #+plot line * lisp/org-plot.el (org-plot/gnuplot): When called with point at the start of the #+plot: line, the behaviour of `org-table-begin' (called in `org-table-to-lisp') caused no table to be detected. To work around this, when the point is at the zeroth column, it is temporarily shifted one character to the right. --- lisp/org-plot.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/org-plot.el b/lisp/org-plot.el index ddd9f78..54c06d6 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -650,7 +650,11 @@ line directly before or after the table." (setf params (org-plot/collect-options params)))) ;; collect table and table information (let* ((data-file (make-temp-file "org-plot")) - (table (let ((tbl (org-table-to-lisp))) + (table (let ((tbl (save-excursion + ;; needed due to particularities of `org-table-begin' + (when (= (current-column) 0) + (forward-char 1)) + (org-table-to-lisp)))) (when (pcase (plist-get params :transpose) (`y t) (`yes t)