Re: [PATCH] ob-tangle.el: Speed up tangling

2021-05-01 Thread Bastien
Hi Sébastien, Sébastien Miquel writes: > Indeed, I hadn't thought to run the tests, sorry. I've fixed my code > and modified the `block-order` test in order for it to pass. Applied with commit a2cb9b853, thank you very much for the updated patch. > The patch does modify the order of the tangle

Re: [PATCH] ob-tangle.el: Speed up tangling

2021-05-01 Thread Sébastien Miquel
Hi Bastien, Bastien writes: The compiler is complaining with In toplevel form: ob-tangle.el:196:1: Warning: Variable ‘modes’ left uninitialized Also, it breaks these two tests for me: 2 unexpected results: FAILED ob-tangle/block-order FAILED ob-tangle/continued-code-blocks-w-n

Re: [PATCH] ob-tangle.el: Speed up tangling

2021-05-01 Thread Bastien
Hi Sébastien, thanks for the patch! I applied against master and tested it. The compiler is complaining with In toplevel form: ob-tangle.el:196:1: Warning: Variable ‘modes’ left uninitialized Also, it breaks these two tests for me: 2 unexpected results:

Re: [PATCH] ob-tangle.el: Speed up tangling

2021-04-21 Thread Timothy
Sébastien Miquel writes: > On second thought, I'm uneasy about my approach. If tangling fails, > the user might miss the error message since it is quickly replaced by > the tangling info. Ideally we should backup all the tangled files and > restore them all if a single one fails to ensure we're

Re: [PATCH] ob-tangle.el: Speed up tangling

2021-04-20 Thread Sébastien Miquel
Hi Tom, Thank you again for your comments. Tom Gillespie writes: I think that the location of condition-case is ok, but I wonder what would happen if something were to fail before entering that? I think that only a subset of the files would be tangled, but they would all have their correct mode

Re: [PATCH] ob-tangle.el: Speed up tangling

2021-04-20 Thread Tom Gillespie
Hi Sébastien, The temp -> rename approach is good, but you should probably use make-temp-file to create the file to reduce the risk of collisions/race conditions. For example as (make-temp-file (concat file-name ".tangling")). I think that the location of condition-case is ok, but I wonder wha

Re: [PATCH] ob-tangle.el: Speed up tangling

2021-04-19 Thread Sébastien Miquel
Hi Tom, Thank you for the comments. Tom Gillespie writes: > All of the issues that I'm aware of are related to what > happens if tangling fails part way through the process. That's not something I had considered. I wrote a new version of the patch (attached) which addresses the insecure behavio

Re: [PATCH] ob-tangle.el: Speed up tangling

2021-04-18 Thread Tom Gillespie
Hi Sébastien, Some comments while looking over this (will report back when I have tested it out as well). This is a section of the ob export functionality that I have been looking for on and off for quite a while because it is responsible for some bad and insecure behavior. I think that some of

[PATCH] ob-tangle.el: Speed up tangling

2021-04-18 Thread Sébastien Miquel
ob-tangle.el: Speed up tangling ,* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Group collected blocks by tangled file name. (org-babel-tangle): Avoid quadratic behavior in number of blocks. --- lisp/ob-tangle.el | 148 ++ 1 file changed, 71 inserti