1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-04 08:47:03 +00:00

org-plot.el: fix logic error in transposition

* lisp/org-plot.el (org-plot/gnuplot): If statement in transposition
treated condition as its negative, to fix this the condition was
inverted.

It was also noticed that the code could not operate as expected as the
user-supplied #+plot options were not fetched.  Resolved by re-inserting
relevant code from an older version of org-plot.
This commit is contained in:
TEC 2020-07-30 18:25:19 +08:00 committed by Bastien
parent 74f6a9610e
commit 14a66b2b3a

View File

@ -580,6 +580,10 @@ line directly before or after the table."
(dolist (pair org-plot/gnuplot-default-options) (dolist (pair org-plot/gnuplot-default-options)
(unless (plist-member params (car pair)) (unless (plist-member params (car pair))
(setf params (plist-put params (car pair) (cdr pair))))) (setf params (plist-put params (car pair) (cdr pair)))))
;; Collect options.
(save-excursion (while (and (equal 0 (forward-line -1))
(looking-at "[[:space:]]*#\\+"))
(setf params (org-plot/collect-options params))))
;; collect table and table information ;; collect table and table information
(let* ((data-file (make-temp-file "org-plot")) (let* ((data-file (make-temp-file "org-plot"))
(table (let ((tbl (org-table-to-lisp))) (table (let ((tbl (org-table-to-lisp)))
@ -587,7 +591,7 @@ line directly before or after the table."
('y t) ('y t)
('yes t) ('yes t)
('t t)) ('t t))
(if (memq 'hline tbl) (if (not (memq 'hline tbl))
(setq tbl (apply #'cl-mapcar #'list tbl)) (setq tbl (apply #'cl-mapcar #'list tbl))
;; When present, remove hlines as they can't (currentily) be easily transposed. ;; When present, remove hlines as they can't (currentily) be easily transposed.
(setq tbl (apply #'cl-mapcar #'list (setq tbl (apply #'cl-mapcar #'list