Re: [PATCH] remove unused code in ob-octave.el

2023-02-14 Thread Leo Butler
On Fri, Feb 10 2023, Max Nikulin  wrote:

> On 10/02/2023 04:21, Leo Butler wrote:
>> In lisp/ob-octave.el:
>> What is the point of ob-octave-prep-session:octave or its brother,
>> ob-octave-prep-session:matlab?
>> These two functions are unused in the existing code.
>
> Have you checked the following? I am not familiar with org-babel code.
>
> grep -nH org-babel-prep-session lisp/ob-core.el
> lisp/ob-core.el:1041:  (prep-cmd (intern (concat
> "org-babel-prep-session:" lang
> lisp/ob-core.el:1050: (error "No org-babel-prep-session function for
> %s!" lang))
>
> Do test passes when you patch is applied? It might mean that test
> coverage is not perfect.

Yes, the tests pass after removing the code.

I can see from your and Ihor's response that my suggestion is
wrongheaded. 

After looking more carefully at ob-core, I am not sure how I could write
a test for the prep-session code, though. The comment and docstring in
ob-template.el does not help me, I am afraid. And the existing
session-related tests do not touch the prep-session code.

I'll poke around in other ob-*.el code and see if I can figure it out.

Leo


Re: [PATCH] remove unused code in ob-octave.el

2023-02-10 Thread Ihor Radchenko
Leo Butler  writes:

> What is the point of ob-octave-prep-session:octave or its brother,
> ob-octave-prep-session:matlab?
>
> These two functions are unused in the existing code.

They are used.
ob-core.el library prescribed certain function names to be defined in
order to declare new babel backend:
- org-babel-default-header-args:lang
- org-babel-execute:lang
- org-babel-expand-body:lang
- org-babel-variable-assignments:lang
- org-babel-header-args:lang
- org-babel-load-session:lang
- org-babel-lang-initiate-session
- org-babel-prep-session:lang

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] remove unused code in ob-octave.el

2023-02-09 Thread Max Nikulin

On 10/02/2023 04:21, Leo Butler wrote:

In lisp/ob-octave.el:

What is the point of ob-octave-prep-session:octave or its brother,
ob-octave-prep-session:matlab?

These two functions are unused in the existing code.


Have you checked the following? I am not familiar with org-babel code.

grep -nH org-babel-prep-session lisp/ob-core.el
lisp/ob-core.el:1041:	 (prep-cmd (intern (concat 
"org-babel-prep-session:" lang
lisp/ob-core.el:1050:	(error "No org-babel-prep-session function for 
%s!" lang))


Do test passes when you patch is applied? It might mean that test 
coverage is not perfect.