[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 2ae3083 2/2: org-plot: Fix calling at start of #+pl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 2ae3083 2/2: org-plot: Fix calling at start of #+plot line |
Date: |
Sun, 9 May 2021 11:57:12 -0400 (EDT) |
branch: externals/org
commit 2ae308342a2daaac2394e4dd94b423d61dbc520c
Author: TEC <tec@tecosaur.com>
Commit: TEC <tec@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)