Re: babel link bug

2020-02-08 Thread Nicolas Goaziou
Hello,

Matt Huszagh  writes:

> -   (let ((file (and (member "file" result-params)
> -(cdr (assq :file params)
> +   (let ((file (cdr (assq :file params

This patch is wrong, with it, :file parameter alone would imply file
result, which is not sufficient. See commit
26ed66b23335eb389f1f2859e409f46f66279e15

"link" format is only meant to be used with "file" output.

Regards,

-- 
Nicolas Goaziou



babel link bug

2020-02-07 Thread Matt Huszagh
The patch below fixes a bug with the behavior of link without file for
babel source blocks. All explained in patch message, but let me know if
any concerns.

>From 25d363bbc3cd7122287364f25f9b5d653bcae232 Mon Sep 17 00:00:00 2001
From: Matt Huszagh 
Date: Fri, 7 Feb 2020 23:09:48 -0800
Subject: [PATCH] ob-core.el: fix silent ouput of babel link format
Cc: emacs 

The file type and link format are distinct according to the
manual. Previous code required file type in order for link to
work. This is distinct from the file header argument that is required
for link to work.

To see why this is a bug, try the code under link in the manual

 #+begin_src shell :results link :file "download.tar.gz"
 wget -c "http://example.com/download.tar.gz;
 #+end_src

This will download the file but will not generate any results.
---
 lisp/ob-core.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 1a0122192..53168edc8 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -709,8 +709,7 @@ block."
 			   (not (listp r)))
 			  (list (list r))
 			r)))
-	  (let ((file (and (member "file" result-params)
-			   (cdr (assq :file params)
+	  (let ((file (cdr (assq :file params
 		;; If non-empty result and :file then write to :file.
 		(when file
 		  ;; If `:results' are special types like `link' or
-- 
2.25.0