ob-async icon indicating copy to clipboard operation
ob-async copied to clipboard

ob-async: update function signature of ob-async-org-babel-execute-src…

Open stsquad opened this issue 3 years ago • 5 comments

…-block

Since 0625651e (Update to Org 9.6-3-ga4d38e) ob-async has been broken on the emacs-29 branch. Fix this by expanding the function to include the extra parameters.

This works but I'm unsure what effect it will have on older emacsen.

Fixes: #92 Signed-off-by: Alex Bennée [email protected]

stsquad avatar Dec 20 '22 19:12 stsquad

I tested this change on 28.2 and it seemed to work ok.

stsquad avatar Dec 20 '22 20:12 stsquad

Alex Bennée @.***> writes:

Since 0625651e (Update to Org 9.6-3-ga4d38e) ob-async has been broken on the emacs-29 branch. Fix this by expanding the function to include the extra parameters.

This works but I'm unsure what effect it will have on older emacsen.

When advising functions with optional parameters, I suggest to use &rest in the advise arglist + apply when calling the origin function. This is forward-compatible against adding new optional parameters.

-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92

yantar92 avatar Dec 21 '22 10:12 yantar92

@yantar92 so something like this:

(defun ob-async-org-babel-execute-src-block ( &optional orig-fun arg info params
                                              &rest executor-type) ; since 9.6-3

are you suggesting replacing the direct funcalls:

    (funcall orig-fun arg info params executor-type))

with:

    (apply orig-fun arg info params executor-type))

stsquad avatar Dec 21 '22 14:12 stsquad

Alex Bennée @.***> writes:

@yantar92 so something like this:

(defun ob-async-org-babel-execute-src-block ( &optional orig-fun arg info params
                                              &rest executor-type) ; since 9.6-3

Almost.

Just ... &rest other-args

It will work both in old and new versions and also if Org introduces new optional arguments.

-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92

yantar92 avatar Dec 21 '22 14:12 yantar92

@yantar92 ok final update, and I tweaked the commit message as well. @astahlman happy to merge?

stsquad avatar Dec 21 '22 15:12 stsquad