From 5a1b9ff8f3ba5be565828137460023cd39194b6c Mon Sep 17 00:00:00 2001 From: TEC Date: Thu, 9 Jul 2020 05:05:20 +0800 Subject: [PATCH 07/11] org-plot.el: tweak term, preamble custom vars * lisp/org-plot.el (org-plot/gnuplot-script): Call the term and preamble functions (mentioned below) with the plot type as the argument. (org-plot/gnuplot-script-preamble, org-plot/gnuplot-term-extra): update docstring. --- lisp/org-plot.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/org-plot.el b/lisp/org-plot.el index ed4cea195..52422ea2f 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -284,7 +284,8 @@ only present in one alist, DEFAULT is used as the second argument for the FUNCTI (defcustom org-plot/gnuplot-script-preamble "" "String or function which provides content to be inserted into the GNUPlot script before the plot command. Not that this is in addition to, not instead of -other content generated in `org-plot/gnuplot-script'." +other content generated in `org-plot/gnuplot-script'. +If a function, it is called with the plot type as the argument." :group 'org-plot :type '(choice string function)) @@ -334,7 +335,8 @@ that function. i.e. it is called with the following arguments: (defcustom org-plot/gnuplot-term-extra "" "String or function which provides the extra term options. E.g. a value of \"size 1050,650\" would cause -\"set term ... size 1050,650\" to be used." +\"set term ... size 1050,650\" to be used. +If a function, it is called with the plot type as the argument." :group 'org-plot :type '(choice string function)) @@ -374,14 +376,14 @@ manner suitable for prepending to a user-specified script." (if file (file-name-extension file) "GNUTERM") (if (stringp org-plot/gnuplot-term-extra) org-plot/gnuplot-term-extra - (org-plot/gnuplot-term-extra)))) + (org-plot/gnuplot-term-extra type)))) (when file ; output file (funcall ats (format "set output '%s'" file))) (funcall ats (if (stringp org-plot/gnuplot-script-preamble) org-plot/gnuplot-script-preamble - (org-plot/gnuplot-script-preamble))) + (org-plot/gnuplot-script-preamble type))) (pcase type ; type (`2d ()) -- 2.28.0