emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Org 9.6-pre and Bash sessions


From: Rudolf Adamkovič
Subject: Re: Org 9.6-pre and Bash sessions
Date: Fri, 21 Oct 2022 15:38:31 +0200

Ihor Radchenko <yantar92@posteo.net> writes:

> See the attached tentative patch.
> I'd appreciate some testing. Hopefully, I did not break anything.

I did some testing and found no issues.

Great work!

Below, I include some suggestions regarding the patch.

> * lisp/ob-comint.el (org-babel-comint-with-output): Cleanup empty
> output.  Such output is spitted unnecessarily for multi-line scripts.

- 'cleanup' (noun) -> 'clean up' (verb)
- 'spitted' -> ??? (did you mean 'split', perhaps?)

> * testing/lisp/test-ob-shell.el (test-ob-shell/session): Add test.

- 'test' -> 'a test'

> +  (let ((res (org-babel-execute:sh "if true; then\necho \"yes\"\nfi" 
> '((:session . "yes")))))

This line has 93 columns, which makes it needlessly hard to read.

Consider,

(let ((result (org-babel-execute:sh
                 "if true \n then \n echo yes \n fi"
                 '((:session . "yes")))))
    (should result)
    (should (string= "yes" result)))

I replaced the remaining semicolons with newlines, given the test
focuses on "multi-line scripts".  Further, I removed the needless
(escaped) quotes around "yes".  Lastly, I renamed 'res' to 'result',
improving readability and consistency, given the file already uses
'result' in another 'let'.

Rudy
-- 
"Programming reliably -- must be an activity of an undeniably
mathematical nature […] You see, mathematics is about thinking, and
doing mathematics is always trying to think as well as possible."
-- Edsger W. Dijkstra, 1981

Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



reply via email to

[Prev in Thread] Current Thread [Next in Thread]