branch: externals/org
commit 55913131192c8304efaf921c4ccd982e709f1b08
Author: Paul Bryan <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    org-plot: Make labels set by options take precedence over table headers
    
    * lisp/org-plot.el (org-plot/gnuplot): Make labels set by options take
    precedence over table headers.
    
    TINYCHANGE
    
    Reported-by: "Dr. Arne Babenhauserheide" <[email protected]>
    Link: https://list.orgmode.org/[email protected]/
---
 lisp/org-plot.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 53a218b3af5..bfb1fd6931c 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -691,15 +691,12 @@ line directly before or after the table."
 
       (unless type
        (user-error "Org-plot type `%s' is undefined" (plist-get params 
:plot-type)))
-
+      ;; Set labels from table heading unless already set
       (when (eq (cadr table) 'hline)
-       (setf params
-             (plist-put params :labels (car table))) ; headers to labels
+       (unless (plist-member params :labels)
+            (setf params
+                 (plist-put params :labels (car table)))) ; headers to labels
        (setf table (delq 'hline (cdr table)))) ; clean non-data from table
-      ;; Collect options.
-      (save-excursion (while (and (equal 0 (forward-line -1))
-                                 (looking-at "[[:space:]]*#\\+"))
-                       (setf params (org-plot/collect-options params))))
       ;; Ensure that the user can override any plot parameter, and
       ;; that the parameters set by the plot type in
       ;; `org-plot/preset-plot-types' is respected.

Reply via email to