* [PATCH] remove unused code in ob-octave.el
@ 2023-02-09 21:21 Leo Butler
2023-02-10 2:32 ` Max Nikulin
2023-02-10 12:02 ` Ihor Radchenko
0 siblings, 2 replies; 4+ messages in thread
From: Leo Butler @ 2023-02-09 21:21 UTC (permalink / raw)
To: Org Mode Mailing List
[-- Attachment #1: Type: text/plain, Size: 190 bytes --]
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.
Leo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: remove unused code.patch --]
[-- Type: text/x-diff; name="0001-lisp-ob-octave.el-remove-org-babel-prep-session-octa.patch", Size: 1848 bytes --]
From f91562d9ea36d7f76f222e457c8fd1b0570e7e3d Mon Sep 17 00:00:00 2001
From: Leo Butler <leo.butler@umanitoba.ca>
Date: Thu, 9 Feb 2023 11:02:04 -0600
Subject: [PATCH] lisp/ob-octave.el: remove
org-babel-prep-session:{octave,matlab}
* lisp/ob-octave.el (org-babel-prep-session:matlab,
org-babel-prep-session:octave): Remove unused functions.
---
lisp/ob-octave.el | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el
index 9bf16b984..24537ad57 100644
--- a/lisp/ob-octave.el
+++ b/lisp/ob-octave.el
@@ -104,10 +104,6 @@ end")
(org-babel-pick-name
(cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
-(defun org-babel-prep-session:matlab (session params)
- "Prepare SESSION according to PARAMS."
- (org-babel-prep-session:octave session params 'matlab))
-
(defun org-babel-variable-assignments:octave (params)
"Return list of octave statements assigning the block's variables."
(mapcar
@@ -133,17 +129,6 @@ specifying a variable of the same value."
(t
(format "%s" var)))))
-(defun org-babel-prep-session:octave (session params &optional matlabp)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (let* ((session (org-babel-octave-initiate-session session params matlabp))
- (var-lines (org-babel-variable-assignments:octave params)))
- (org-babel-comint-in-buffer session
- (mapc (lambda (var)
- (end-of-line 1) (insert var) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session))
- var-lines))
- session))
-
(defun org-babel-matlab-initiate-session (&optional session params)
"Create a matlab inferior process buffer.
If there is not a current inferior-process-buffer in SESSION then
--
2.39.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] remove unused code in ob-octave.el
2023-02-09 21:21 [PATCH] remove unused code in ob-octave.el Leo Butler
@ 2023-02-10 2:32 ` Max Nikulin
2023-02-14 17:50 ` Leo Butler
2023-02-10 12:02 ` Ihor Radchenko
1 sibling, 1 reply; 4+ messages in thread
From: Max Nikulin @ 2023-02-10 2:32 UTC (permalink / raw)
To: Leo Butler, Org Mode Mailing List
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] remove unused code in ob-octave.el
2023-02-09 21:21 [PATCH] remove unused code in ob-octave.el Leo Butler
2023-02-10 2:32 ` Max Nikulin
@ 2023-02-10 12:02 ` Ihor Radchenko
1 sibling, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2023-02-10 12:02 UTC (permalink / raw)
To: Leo Butler; +Cc: Org Mode Mailing List
Leo Butler <Leo.Butler@umanitoba.ca> 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 <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] remove unused code in ob-octave.el
2023-02-10 2:32 ` Max Nikulin
@ 2023-02-14 17:50 ` Leo Butler
0 siblings, 0 replies; 4+ messages in thread
From: Leo Butler @ 2023-02-14 17:50 UTC (permalink / raw)
To: Max Nikulin; +Cc: Org Mode Mailing List
On Fri, Feb 10 2023, Max Nikulin <manikulin@gmail.com> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-14 17:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09 21:21 [PATCH] remove unused code in ob-octave.el Leo Butler
2023-02-10 2:32 ` Max Nikulin
2023-02-14 17:50 ` Leo Butler
2023-02-10 12:02 ` Ihor Radchenko
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.