emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ob-gnuplot: Fix error on non-string :var assignment
@ 2020-12-16  8:30 Ihor Radchenko
  2020-12-16 11:42 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Ihor Radchenko @ 2020-12-16  8:30 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

The following gnuplot code stopped working after recent commits adding
support of remote files:

#+CALL: stress-strain[:file stress-displ-RD-11.png](A=0.87, alpha=38.0, beta=7.0, inp="p11 DC.txt", tbl="stress-displ-RD-11.txt")

Note that the code assigns several numerical variables. ob-gnuplot from
master throws error when checking (file-remote-p ...).

The fix is attached.

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ob-gnuplot-Fix-error-on-non-string-var-assignment.patch --]
[-- Type: text/x-diff, Size: 1115 bytes --]

From 8840afe1446177e5355e190fcaf6ce79d00ac0c6 Mon Sep 17 00:00:00 2001
From: Ihor Radchenko <yantar92@gmail.com>
Date: Wed, 16 Dec 2020 16:23:41 +0800
Subject: [PATCH] ob-gnuplot: Fix error on non-string :var assignment

* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): Consider that
not all the variable values must be a string in :var assignments.
---
 lisp/ob-gnuplot.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-gnuplot.el b/lisp/ob-gnuplot.el
index d0cedb7a3..708ac97e4 100644
--- a/lisp/ob-gnuplot.el
+++ b/lisp/ob-gnuplot.el
@@ -94,7 +94,8 @@ code."
 		      (tablep (or (listp first) (symbolp first))))
 		 (if tablep val (mapcar 'list val)))
 	       (org-babel-temp-file "gnuplot-") params)
-	    (if (and (file-remote-p val)  ;; check if val is a remote file
+	    (if (and (stringp val)
+		     (file-remote-p val)  ;; check if val is a remote file
 		     (file-exists-p val)) ;; call to file-exists-p is slow, maybe remove it
 		(let* ((local-name (concat ;; create a unique filename to avoid multiple downloads
 				org-babel-temporary-directory
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ob-gnuplot: Fix error on non-string :var assignment
  2020-12-16  8:30 [PATCH] ob-gnuplot: Fix error on non-string :var assignment Ihor Radchenko
@ 2020-12-16 11:42 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2020-12-16 11:42 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi Ihor,

Ihor Radchenko <yantar92@gmail.com> writes:

> The following gnuplot code stopped working after recent commits adding
> support of remote files:
>
> #+CALL: stress-strain[:file stress-displ-RD-11.png](A=0.87, alpha=38.0, beta=7.0, inp="p11 DC.txt", tbl="stress-displ-RD-11.txt")
>
> Note that the code assigns several numerical variables. ob-gnuplot from
> master throws error when checking (file-remote-p ...).
>
> The fix is attached.

Applied on master (baf1e7a64), thanks!

-- 
 Bastien


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-16 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16  8:30 [PATCH] ob-gnuplot: Fix error on non-string :var assignment Ihor Radchenko
2020-12-16 11:42 ` Bastien

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).