From c154151fbc3383ff8bcc735542e446c82c18a868 Mon Sep 17 00:00:00 2001 From: TEC Date: Thu, 9 Jul 2020 05:05:20 +0800 Subject: [PATCH 7/8] Org-plot: tweak term and preamble custom vars The custom variables `org-plot/gnuplot-script-preamble' and `org-plot/gnuplot-term-extra' now take the plot type as an argument. --- 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 d6146d23d..3b486fed2 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.27.0