Jeff Trull <edas...@att.net> writes: > I notice that multiple #+PLOT lines before a table will be coalesced and > handled as one. However, this is > accomplished through specific code in org-plot.el that does a reverse > search through the buffer for > additional lines. org-element has a built-in mechanism for this, > org-element-multiple-keywords. It seems > like it would be useful to add PLOT to it. Can that be done? If not, is > there a way to temporarily add it for > an exporter (i.e. after the export is launched but before the buffer is > parsed)?
Yes, it can be done. However, in addition to changing the parser, we should also make use of the change in org-plot itself. I tried to do this, and noticed that `org-plot/gnuplot' promises to parse #+TABLE options _after_ the table as well. Affiliated keywords are of no help then. Further, I reviewed the two calls to `org-plot/collect-options' in org-table.el and noticed that the second call is no longer doing the right thing of scanning #+PLOT lines after the table - since commit ac3148ef8 (by Timothy): org-plot: Don't move point when plotting * lisp/org-plot.el (org-plot/gnuplot): Expanding the `save-excursion' block to include `org-plot/goto-nearest-table` prevents the current point from being moved, and doesn't affect the rest of the function. Timothy, may you please take a look? We may drop support for the #+PLOT lines after the table - they are not really documented in our manual. Though it will technically be a breaking change, so I am not 100% sure. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>