Bladeren bron

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.
TEC 4 jaren geleden
bovenliggende
commit
2ae308342a
1 gewijzigde bestanden met toevoegingen van 5 en 1 verwijderingen
  1. 5 1
      lisp/org-plot.el

+ 5 - 1
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)