Re: R terminal output does not match src block output due to ">" character in results

2022-01-23 Thread Jack Kamm
Hi John, > $ git log > commit 7fa8173282f85c2ca03cc7f51f28f6adfb250610 (HEAD -> master, > origin/master, origin/HEAD) > Author: Ian Martins > Date: Sat Jan 16 15:52:21 2021 -0500 It looks like the last commit you're on is from about a year ago (Jan 2021), so I suspect you're on an older

Re: [BUG] ob-python :results value pp does not working

2021-12-31 Thread Jack Kamm
Hi Christopher, > This might need to mentioned in Org manual and in ob-python.el source > code with comment. WDYT? The main documentation for this is in the Worg page for ob-python, in particular see the section "Return values":

Re: [BUG] ob-python :results value pp does not working

2021-12-30 Thread Jack Kamm
For non-session Python blocks, you need to use "return" on the value, as if you are in a function. The following works for me: #+begin_src python :results value pp dic = {'key1': 1, 'b': 2} return dic #+end_src #+RESULTS: : {'b': 2, 'key1': 1}

Re: [PATCH] async process in R

2021-10-02 Thread Jack Kamm
I just noticed one more thing, regarding ess-eval-visibly etc: >> + (setq user-inject-src-param ess-inject-source) >> (setq ess-eval-visibly nil) >> + (setq ess-inject-source 'function-and-buffer) >> (ess-eval-buffer nil)) >> - (setq ess-eval-visibly

Re: [PATCH] async process in R

2021-10-02 Thread Jack Kamm
Hi Jeremie and Chuck, >> But changing to `:async yes', the error aborts in a way that omits the >> output. > > Interesting, I haven't thought about errors cases enough. Async process > will be on the 9.5 release and this issue will be next on the todo list. > Many thanks again for the feedback.

Re: [PATCH] async process in R

2021-10-02 Thread Jack Kamm
Hi Jeremie, Many thanks for bringing this over the finish line! I'm very glad it made it into Org 9.5. All the tests passed on my end, and and I successfully ran a few async R blocks without any issues. I do have some suggestions for code style below. They apply to both the original patch, as

Re: [PATCH] async process in R

2021-09-27 Thread Jack Kamm
Hi Jeremie, > For the parameter :async without any values assigned to it. I'm > coordinating with ob-python.el and the orginal package > https://github.com/jackkamm/ob-session-async. > > Jack do you see the need to change it and expect :async to have the > value yes or no? I wrote the :async

Re: Bug: ob-python issue in Emacs 28 [9.4.4]

2021-09-13 Thread Jack Kamm
Hi Augusto, > In Emacs 28, `python-shell-send-string' prints an additional newline > between the prompt and output (among other things, so you can tell > whether or not the inferior process is busy at any given time). > > However, this interferes with ob-python, see e.g. >

Re: [PATCH] ob-R output file with graphics parameter

2021-07-10 Thread Jack Kamm
Hi Chuck, > If you modify the ECM to change `:exports results' to `:exports > none' and clean older fig[12].png's from the directory, the export > fails. Thanks for this example. I had mistakenly thought that code blocks with ":exports none" would be evaluated for side effects, but you are

Re: [PATCH] ob-R output file with graphics parameter

2021-07-06 Thread Jack Kamm
Hi Chuck, > Here is an ECM that when exported with `C-c C-e l o y y` (or 'yes RET' for > each `y' depending on your setup) I don't see the example on your last email, could you try re-attaching it? Thanks, Jack

Re: [PATCH] ob-R output file with graphics parameter

2021-07-06 Thread Jack Kamm
Hello again, >> A user might like to construct a figure consisting of various subfigures >> such as in a subfloat environment. >> >> Will this be reasonably simple to accomplish if `:results graphics' (with no >> `file' element) automatically inserts a link? >> >> Currently, omitting the file

Re: [PATCH] ob-R output file with graphics parameter

2021-07-03 Thread Jack Kamm
Hi Chuck, > A user might like to construct a figure consisting of various subfigures such > as in a subfloat environment. > > Will this be reasonably simple to accomplish if `:results graphics' (with no > `file' element) automatically inserts a link? > > Currently, omitting the file element

Re: [PATCH] ob-R output file with graphics parameter

2021-07-03 Thread Jack Kamm
Timothy writes: > Would it be strange if running the code block with just > > :output graphics > > Automatically added "link" if *only* graphics is set, and generated a > file name if no :file is set? It wouldn't be strange. ob-jupyter [1] auto-generates file names for images, and it's

Re: [PATCH] ob-R output file with graphics parameter

2021-07-02 Thread Jack Kamm
Hi Jeremie, >> The requirement for a second file parameter was added in Org 9.3 to >> support the use case in this thread: >> >> https://orgmode.org/list/3ac2f42a-8ff2-1464-fa36-451e2ef0e...@pressure.to/ >> >> But this syntax is annoyingly verbose for ob-R users, and also broke >> lots of ob-R

Re: [PATCH] ob-R output file with graphics parameter

2021-06-27 Thread Jack Kamm
Hi all, > I obviously missing something. The above works for me without the > patch. Unfortunately, I can't trace back the thread in order to > understand the context. I think this is a followup from this mail: https://orgmode.org/list/87zgxc42qg@gmail.com/ wherein Jeremie states: > The

Re: [BUG] org babel fails with matlab+python kernel on MacOS-10.15 [9.4.6 (release_9.4.6-541-g52b097 @ /Users/oub/emacs/site-lisp/packages/org/)]

2021-06-12 Thread Jack Kamm
Hello Uwe, Uwe Brauer writes: > (defalias 'org-babel-execute:matlab 'org-babel-execute:ipython) ob-ipython is not part of org-mode core, so I don't think this can be considered a bug here. While the original ob-ipython is unmaintained, scimax [1] maintains a fork of it, so you could consider

Re: TMIO Pre-release, request for feedback

2021-06-10 Thread Jack Kamm
Hi Jeremie, Jeremie Juste writes: > Just a precision async process is already available in R. Thanks again > to Jack Kamm for this input. I believe async evaluation in R still requires my external package: https://github.com/jackkamm/ob-session-async Are you sure you don't have that p

Re: literate programming, development log -- ideas?

2021-06-07 Thread Jack Kamm
Hi Greg, Greg Minshall writes: > but i also feel a need for something that might be called a lab > notebook, a development log, of ideas, including dead ends, i pursue > during the development process, with links, etc.. but, i'm not really > sure how to structure this bit, how to integrate it

Re: Moving some lisp/ob-*.el files to org-contrib - your advice?

2021-05-18 Thread Jack Kamm
Eric S Fraga writes: > On Tuesday, 4 May 2021 at 01:49, Timothy wrote: >> For the future, I'd think Julia actually warrants 1st class inclusion in >> Org, and I've instigated an effort to write an ob-julia that works well. > > +1! Happy to help test if you wish. I use Julia as my programming

Re: [PATCH] Async session eval (2nd attempt)

2021-05-18 Thread Jack Kamm
Sorry for the noise, replying to add the X-Woof-Patch:applied header.

Re: [PATCH] Async session eval (2nd attempt)

2021-05-18 Thread Jack Kamm
Hi ian, ian martins writes: > I gave this a try and it works for me. One thing I noticed is that if you > run a call asynchronously, the final result ends up under the source block > instead of the call. In the example below both RESULTS were written after > I ran the call. > > #+name:

Re: [PATCH] Async session eval (2nd attempt)

2021-05-18 Thread Jack Kamm
Hi Bastien, Bastien writes: > Please feel free to commit this patch in master so that more people > can test it, we can test and fix oddities while preparing for 9.5. OK, I have incorporated the minor fixes from Kyle's review and pushed to master. Cheers, Jack

Re: [POLL] Setting `org-adapt-indentation' to nil by default?

2021-05-02 Thread Jack Kamm
+1 from me. It is nil in my config, which feels better to me.

Re: [PATCH] Async session eval (2nd attempt)

2021-04-25 Thread Jack Kamm
Hi Timothy, > This is moving at a glacial pace, but I'd love to see this merged --- > there's clearly a lot of interest in this from the community if not > within this mailing list (ob-async which is more limited has 250 stars > on GitHub). Yes, this has taken far too long -- sorry about that.

Re: overloading of internal priority calculations in agenda

2021-03-08 Thread Jack Kamm
Hi Adam, > I further noticed that this overloading of the internal priority by > including timestamp and habit data causes disruption to the behaviour > I imagine most users would expect from `org-agenda-sorting-strategy'. > For example, if you have `priority-down' as the first entry in the >

Re: ob-reticulate: R+Python interface from Babel

2021-03-02 Thread Jack Kamm
Hi Jeremie, > Many thanks for this package. It seems like a better way all together > to manipulate python output. I don't disagree, at least when it comes to handling dataframes. This is because ob-reticulate makes the block actually executed with ob-R.el instead of ob-python.el. R has better

Re: [PATCH] Async session eval (2nd attempt)

2021-02-28 Thread Jack Kamm
ably can't, because it depends on the external async.el.) > p.s. After this is merged, it would be great to see support for other > languages grow :) I also have an async implementation for ob-R that's ready after this is merged :) Cheers, Jack [1] https://github.com/astahlman/ob-async >F

ob-reticulate: R+Python interface from Babel

2021-02-27 Thread Jack Kamm
Hi all, ob-reticulate is now available on MELPA. You can find more information here: https://github.com/jackkamm/ob-reticulate Cheers, Jack

Re: [PATCH] Persistently save downloaded inline remote images

2020-12-07 Thread Jack Kamm
> Jack, as the author of the org-display-remote-inline-images commit, what > do you think about this patch? This patch takes the same approach as an earlier attempt by Kit in 2014 [1]. That patch was never merged; Michael objected that the approach seemed too complex, and suggested using

Re: Bug report: remote file python src output gives FileNotFound (+ suggested fix)

2020-11-28 Thread Jack Kamm
Hi Paul, I'm unable to reproduce the issue, and believe this issue has already been fixed in the latest version of org-mode. See this patch [1]. Could you please upgrade to Org 9.4 and test again? Thanks, Jack [1]

Re: ob-python: import local package into a session

2020-11-24 Thread Jack Kamm
Joost Kremers writes: > I haven't really considered the option to install the utility functions as a > package in the virtual environment, because I expect to change and develop > those > functions together with the rest of the project. If it were a separate > package, > I'd need to reinstall

Re: ob-python: import local package into a session

2020-11-23 Thread Jack Kamm
Jack Kamm writes: > You need to make sure your module is either in the working directory you > started the Python session in, or in your PYTHONPATH, for example by > adjusting os.env["PYTHONPATH"] before attempting to import the module. Sorry, this was incorrect, you nee

Re: ob-python: import local package into a session

2020-11-23 Thread Jack Kamm
Hi Joost, > What I'm trying to do is to import a Python file with a bunch of utility > functions into the ob-python session. I thought this might be possible if I'd > structure my code as a regular Python package, because that works if I want to > import my utility functions into another Python

Re: [PATCH] New "project" option for org-link-file-path-type

2020-11-11 Thread Jack Kamm
Thanks, I've fixed the remaining issues you pointed out and pushed this in 5371b30fe. Cheers, Jack

Re: [PATCH] New "project" option for org-link-file-path-type

2020-11-04 Thread Jack Kamm
ood catch. I didn't realize I was using project.el from ELPA but it turns out I was. >From d156a9cfcdbfb9be72df3976e2355f48cf10 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Wed, 28 Oct 2020 17:29:04 -0700 Subject: [PATCH] ol.el: New option to set org-link-file-path-type to a function * lis

Re: Org mode fontification error in # in python and ipython source blocks

2020-11-01 Thread Jack Kamm
Hi Sebastian -- > I am having problems with the fontification of python and ipython source > blocks when the code contains curly brackets "{}" (other course blocks are > ok). For instance, the following snippet > > #+BEGIN_SRC python :results drawer > import matplotlib.pyplot as plt >

Re: Bug: HTML not formatted correctly from R source code block [9.3.6 (9.3.6-23-g01ee25-elpaplus @ /home/opdfa/.emacs.d/elpa/org-plus-contrib-20200309/)]

2020-11-01 Thread Jack Kamm
Hi Steven, Sorry for the delayed response. > The problem, however, is that what is exported to html and displayed in the > exported block is either the actual UUID or the tempfile path and not the > results from evaluating the R code. In the case of the tempfile, the tempfile > exists but is

Re: Thoughts on the standardization of Org

2020-11-01 Thread Jack Kamm
Hi Timothy, TEC writes: > I feel that this also ties into my earlier idea of putting Emacs > as/inside an LSP server for Org. I suspect there may be a a lot > of > potential in making it dead easy to use Emacs as a tool. I'm too busy to help on this, but I think it's a very good idea and

[PATCH] New "project" option for org-link-file-path-type

2020-10-28 Thread Jack Kamm
ck whether the functionality is available, and to silence compiler warnings. I'm not sure if this is the correct way to do it. >From c5f9d4043a6cf6a325d122be24214356f36446f1 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Wed, 28 Oct 2020 17:29:04 -0700 Subject: [PATCH] ol.el: New option "pro

Re: Help debugging R source code block output problem with :session

2020-10-28 Thread Jack Kamm
Hi Jeremie, Thanks for volunteering to maintain ob-R.el :) I'm bumping this patch [0] to see if it could be merged into ob-R.el. It fixes some long-standing issues with prompt mangling for :session blocks with :results output. Elsewhere in the thread, Chuck had a suggestion [1] to allow

Re: New website - back to the old unicorn!

2020-10-26 Thread Jack Kamm
Thank you Timothy! It looks great. Bastien writes: > Dear all, > > thanks to the initiative and the patient efforts of Timothy, our > website has been revamped: new contents, new look and... the old > unicorn! > > Thanks very much to Timothy and to everyone who contributed with > feedback and

[PATCH] Async session eval (2nd attempt)

2020-10-25 Thread Jack Kamm
Ruby implementation which was externally contributed. [0] https://orgmode.org/list/87muj04xim.fsf@jaheira.i-did-not-set--mail-host-address--so-tickle-me/ [1] https://github.com/jackkamm/ob-session-async >From 8b7695a148d1831c916737650e115833cb7fc752 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date:

Re: [PATCH] ob-python: Rename exec tmpfile handle to prevent conflict

2020-10-24 Thread Jack Kamm
Thanks Bastien, the Woof! tool looks interesting. By the way, on seeing this thread again, I realized this patch probably should have been applied to the maint branch. So I've cherry picked it into there, and merged back into master. Bastien writes: > Hi Jack and Adrian, > >

Re: [RFC] ob-reticulate: R+Python interface from Babel

2020-10-11 Thread Jack Kamm
Hi all, I've put ob-reticulate.el on github so it can be more easily used: https://github.com/jackkamm/ob-reticulate I plan to submit it to MELPA or GNU ELPA over the coming weeks as well. Cheers, Jack

Re: Bug: org-babel python with :results value sends function definition with a statement after a for loop to the shell incorrectly [9.3.6 (9.3.6-elpa @ /home/username/.emacs.d/elpa/org-9.3.6/)]

2020-10-10 Thread Jack Kamm
Checking back in on this since Org 9.4 has been released. This issue should be fixed now, and my tests corroborate this. If you're still experiencing this problem after updating, please let me know. Best, Jack Jack Kamm writes: >> I redid the test but loaded the lastest or

Re: [PATCH] ob-python: Rename exec tmpfile handle to prevent conflict

2020-10-10 Thread Jack Kamm
Hi Adrian, Adrian Kummerländer writes: > I noticed that after updating to Org 9.4 many of my Python-based Org > files fail to execute with various `io.TextIOWrapper' related error > messages. The reason for this is that opening the exec tmpfile as `f' > shadows this possibly user-defined

Re: [PATCH] Expanded ob-python results handling and plotting

2020-09-27 Thread Jack Kamm
Thanks -- I've pushed this to master now. Jack Bastien writes: > Hi Jack, > > Jack Kamm writes: > >> For now, I think I prefer to keep ob-python leaner, so am going to hold >> off on this. > > The leaner the less maintainance ahead :) > >> I'll wait a

Re: [PATCH] Expanded ob-python results handling and plotting

2020-09-19 Thread Jack Kamm
[1] worg commit 59e320ad Cheers, Jack >From 118d8b5eb817e9a21e9d84f2f942fcc841ddc51f Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Sat, 19 Sep 2020 08:44:30 -0700 Subject: [PATCH] ob-python: Improvements to :return header argument * lisp/ob-python.el (org-babel-execute:python): Allow return-

Re: [PATCH] org-add-planning-info: respect caller's given time [9.3.7 (release_9.3.7-716-g3d4876 @ /home/n/.emacs.d/straight/build/org/)]

2020-09-09 Thread Jack Kamm
Kyle Meyer writes: > With Org's master (f17d301e1), the second one hangs for me with Emacs > 26.3. Quickly stepping through org-babel-python--send-string, it > appears to get stuck in the accept-process-output call. > > Using an Emacs built from master, there's no hang on my end either. If >

Re: Help debugging R source code block output problem with :session

2020-09-08 Thread Jack Kamm
Hi Chuck, > this is already present in `org-babel-R-evaluate-session' in the call to > `org-babel-comint-eval-invisibly-and-wait-for-file'' just a couple of lines > further down in the `(cl-case result-type (value ...))' branch. > > The other use of `tmp-file' in that block is the one that

Re: Help debugging R source code block output problem with :session

2020-09-08 Thread Jack Kamm
"Berry, Charles" writes: > Also, I wonder if the `:results value' case can be handled in a similar > manner, viz. > > - (let ((tmp-file (org-babel-temp-file "R-"))) > + (let ((tmp-file (with-current-buffer session (org-babel-temp-file "R-" Yes, if we did that then tmp-file would have a

Re: [PATCH] org-add-planning-info: respect caller's given time [9.3.7 (release_9.3.7-716-g3d4876 @ /home/n/.emacs.d/straight/build/org/)]

2020-09-08 Thread Jack Kamm
Kyle Meyer writes: > That's on a Debian system with the python executable pointing to Python > 2.7.16. If I set org-babel-python-command to python3 (3.7.3) at the top > of test-ob-python.el, I see the same thing. I haven't dug any farther > yet. Jack, presumably you don't see the stall on

Re: Help debugging R source code block output problem with :session

2020-09-07 Thread Jack Kamm
Hi Chuck, > I can confirm that this works on my setup in each of the scenarios in which > `default-directory' got set correctly in the session buffer. > > At some point, my default-directory got reset to drop the tramp prefix > "/scp:/user@host:" in one session after faithfully running the src

Re: Help debugging R source code block output problem with :session

2020-09-07 Thread Jack Kamm
; locally and then ssh in, it's still possible to have default-directory set, but it requires some configuration [1]. Or you could use "M-x cd" to set it as well. [1] https://emacs.stackexchange.com/questions/5589/automatically-update-default-directory-when-pwd-changes-in-shell-mode-and-t

Re: Help debugging R source code block output problem with :session

2020-09-07 Thread Jack Kamm
I just realized my patch had an issue where it freezes if there is an error in the source block. I'm attaching a second patch, to be applied on top of the first one, that fixes the issue. diff --git a/lisp/ob-R.el b/lisp/ob-R.el index b37e3965a..5ddf0ebd1 100644 --- a/lisp/ob-R.el +++

Re: Help debugging R source code block output problem with :session

2020-09-07 Thread Jack Kamm
mples as unit tests. Cheers, Jack >From 76d0eaa31506ce8a2f81f64eae43161db5721317 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Mon, 7 Sep 2020 00:41:52 -0700 Subject: [PATCH] ob-R: Fix session output with substrings matching prompts * lisp/ob-R.el (ess-send-string): Declare external function

Re: [PATCH] ob-python.el: Fix issue with sessions on remote machines

2020-09-05 Thread Jack Kamm
Hi Bastien, > - A local maintainer is expected to reply to requests and bug reports > regarding the local functionalities he oversees. > > - A local maintainer can commit changes directly to the file(s) he > maintains (either submitted changes or his own). > > - Core maintainers have the

Re: [PATCH] ob-python.el: Fix issue with sessions on remote machines

2020-09-04 Thread Jack Kamm
Hi Bastien, > Would you be okay to add yourself as the ob-python.el maintainer? Sure, I've added myself as maintainer to the header of ob-python.el. > I suggest we have a policy that "Org maintainer(s)" have the last > words on everything in Org's core, but that individual maintainers, > when

Re: [PATCH] Expanded ob-python results handling and plotting

2020-08-30 Thread Jack Kamm
I'm not sure I'm up for it. I also noticed that I had left a couple docstrings as TODOs -- I'll fix those before finalizing the patch over the next couple weeks. >From 76a1ad4d50e6638244d9aa17e45895b8b38b3cd0 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Sun, 30 Aug 2020 08:51:04 -0700 Subje

Re: [PATCH] Expanded ob-python results handling and plotting

2020-08-30 Thread Jack Kamm
ded? Yes, I've done so now. I'm not sure whether it's better to treat it like a row or column vector, but since it has an "index", which are the row names in a DataFrame, I decided to treat it as a column. >From 40db6b5497de78a9e69de219f4686b405db10c81 Mon Sep 17 00:00:00 2001 From

[PATCH] Expanded ob-python results handling and plotting

2020-08-29 Thread Jack Kamm
le of how to plot: #+begin_src python :results output graphics file :file boxplot.svg import matplotlib.pyplot as plt import seaborn as sns plt.figure(figsize=(5, 5)) tips = sns.load_dataset("tips") sns.boxplot(x="day", y="tip", data=tips) #+end_src >From

Re: Help debugging R source code block output problem with :session

2020-08-29 Thread Jack Kamm
0:00:00 2001 From: Jack Kamm Date: Sat, 29 Aug 2020 00:07:58 -0700 Subject: [PATCH] ob-R: Fix prompt mangling in session output * lisp/ob-R.el (org-babel-R-evaluate-session): Force comint prompt regexp to start at beginning of line, to prevent org-babel-comint-with-output from splitting mid-line.

Re: Help debugging R source code block output problem with :session

2020-08-28 Thread Jack Kamm
el before, so thought it would be best to solicit feedback here before merging this in. Cheers, Jack [1] https://orgmode.org/list/875zgjh8wn@gmail.com/ >From 1dc8e2d2cb01a4e6b82342ea8d8c965df8f5222c Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Fri, 28 Aug 2020 19:16:05 -0700 Subject: [

Re: save plot in python babel

2020-08-25 Thread Jack Kamm
Hi Jeremie, > I tried to look around and noticed that the documentation regarding > python with org-mode is aging a bit... Any help will be > appreciated. I'll be ready to improve the documentation of org-babel > python setup as soon as I'm more familiar with it myself. Historically ob-python

[RFC] ob-reticulate: R+Python interface from Babel

2020-08-24 Thread Jack Kamm
ld match between reticulate and R source blocks. Cheers, Jack >From 0f691a200cf088c72f93f7552d73caeafb8d588f Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Mon, 24 Aug 2020 08:02:17 -0700 Subject: [PATCH] ob-reticulate: Babel source lang for R+Python reticulate package * lisp/ob-reticulate.el: New

Re: [PATCH] ob-python.el: Fix issue with sessions on remote machines

2020-08-20 Thread Jack Kamm
Merged now -- thanks for your contribution. Cheers, Jack

Re: [PATCH] ob-python.el: Fix issue with sessions on remote machines

2020-08-18 Thread Jack Kamm
Hi Christian, Thanks for reporting this and providing a fix! > The function `org-babel-python-evaluate-session' doesn't process temp > file names with `org-babel-process-file-name' before inserting them into > the Python code blocks. This causes a 'No such file' error when the > executing the

Re: Bug: org-babel python with :results value sends function definition with a statement after a for loop to the shell incorrectly [9.3.6 (9.3.6-elpa @ /home/username/.emacs.d/elpa/org-9.3.6/)]

2020-07-19 Thread Jack Kamm
> I redid the test but loaded the lastest org-mode and there was no > error. This means you probably don't need to debug this. It has been > fixed in the latest version, but the fix hasn't been updated in the > elpa package yet. you can either wait for the next release or pull > the latest code

Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)]

2020-06-09 Thread Jack Kamm
Hi Kyle, Thanks for the code review which was very helpful as always. I've fixed the style and compile errors that you noticed, and pushed the commit to master. Cheers, Jack

Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)]

2020-06-06 Thread Jack Kamm
n't be indented. I also added a couple more unit tests, one for multiline strings, and one for the variable scope/assignment issue that Matt reported. Cheers, Jack >From 179178d39f6216172e1a070f570cf941f99b1a89 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Sat, 6 Jun 2020 10:59:23 -0700 Subject: [P

Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)]

2020-05-28 Thread Jack Kamm
). In the meantime, I think it better to leave the original bug in place, rather than break any existing ob-python use cases. When I do get to this, I'll submit it as a patch to the list first, to make sure I don't accidentally cause a new bug. Best, Jack Jack Kamm writes: > Hi Matt -- > >> A h

Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)]

2020-05-27 Thread Jack Kamm
Hi Matt -- > A heads up... I believe this changes the scope of the :var variables, > since they previously were local to the main() function and now they are > declared globally. After this change, some of my existing python source > blocks (i.e., ones in which I attempt to assign a new value to

Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)]

2020-05-24 Thread Jack Kamm
Hello, Thanks for reporting. I've just fixed this issue in master (commit 6149b6cb6). The problem was that ob-python adds tab indentation to the code body before putting it inside a main() function, which adds spurious indentation to multiline strings passed through :var. I fixed the issue by

Re: Improving Org Mode for VSCode - Thinking Aloud

2020-05-24 Thread Jack Kamm
It would be very good indeed for org-babel if it could be ported to other editors. One of the biggest drawbacks of org-babel notebooks is that I can't collaborate with my colleagues on them, since I can't expect them to use Emacs. Aside from VSCode, I think RStudio would be an excellent target

Re: Bug: HTML not formatted correctly from R source code block [9.3.6 (9.3.6-23-g01ee25-elpaplus @ /home/opdfa/.emacs.d/elpa/org-plus-contrib-20200309/)]

2020-03-10 Thread Jack Kamm
Hi Steve, Steven Delean writes: > HTML table produced from a source code block (using R code) does not display > because html code is not formatted correctly in the exported html output. I believe this is the same issue as reported here:

Re: Bug or not a bug? dot expansion in ob-shell

2020-03-01 Thread Jack Kamm
As someone who doesn't really use ob-shell, I've made too much noise in this thread, and am intending this to be my last comment here... I think it's a bad idea that ":results value", and not specifying ":results", give different behavior. In my own Org-babel files, I usually have a header line

Re: Bug or not a bug? dot expansion in ob-shell

2020-02-29 Thread Jack Kamm
Hi Tom, Tom Gillespie writes: > As with many things in emacs, I sometimes feel like I'm loosing my > mind, or loosing track of just exactly what variables are set You're not losing your mind. After some further testing I find that you're right, and my understanding of the situation was

Re: Bug or not a bug? dot expansion in ob-shell

2020-02-29 Thread Jack Kamm
Hi Tom, Tom Gillespie writes: > First a disclosure, I would be very unhappy if option 1 were selected, > it would require me to make a whole bunch of changes and try to find > an option to revert to the current default behavior. Wasn't option 1 already the default behavior, until the changes

Re: correct remote path handling

2020-02-29 Thread Jack Kamm
Hi Felipe, It looks like you've made some quite substantial changes to ob-shell. I think it would be a good idea to split this up into 2 patches, and to start a new thread for the ob-shell patch. I'm not as familiar with ob-shell, and it's also had some work lately. So it'd be good to get some

Re: Bug or not a bug? dot expansion in ob-shell

2020-02-29 Thread Jack Kamm
Sorry, I was confused about this: > According to my reading of this thread, most of the commenters were in > agreement that we should keep the original behavior and return the exit > code, as we do in 9.3. Actually, it looks like ":results value" does return the exit code. I just got confused

Re: Bug or not a bug? dot expansion in ob-shell

2020-02-29 Thread Jack Kamm
Hi Bastien, Bastien writes: > thanks for your thoughtful inputs. I've now removed the option. I think it's good you removed the option. However, it looks like the behavior now is to return the output, instead of the exit code, when ":results value". According to my reading of this thread,

Re: correct remote path handling

2020-02-25 Thread Jack Kamm
Hi Felipe, Felipe Lema writes: > I bumped into a problem running src blocks using a remote (tramp) :dir. I've > looked into it and found that the problem is that a temporary file is passed > as a remote path to the remote process (temp file should be local to remote > process). Thanks for

Re: ob-python.el: questions about output

2020-02-24 Thread Jack Kamm
Hi Eric, "Fraga, Eric" writes: > Longer term, better would be an implementation of :prologue and > :epilogue options for python src blocks like we have for Maxima. It > would probably make sense to provide these options for most if not all > src blocks? This sounds interesting. Do you know of

Re: ob-python.el: questions about output

2020-02-24 Thread Jack Kamm
Hi RC, R C writes: > My python src blocks often have both graphical output as well as the > results of some numerical calculation displayed using print statements. > > When exported I would like the line: return 'img/ex1.png' not to be > included in the listing of the src block. > > Also, the

Re: ob-python.el: questions about output

2020-02-23 Thread Jack Kamm
Sorry, my email had a typo: > #+begin_src python :session session1 :results output > x > #+end_src That should be ":results value".

Re: ob-python.el: questions about output

2020-02-23 Thread Jack Kamm
Hi RC, R C writes: > 1. Is it possible to have both types of output displayed from a single src > block to avoid having to duplicate the src block, using :exports results > for one and :exports both for the other? No, there's no option to output both ":results output" and ":results value". If

Re: Bug or not a bug? dot expansion in ob-shell

2020-02-23 Thread Jack Kamm
Hi Stefan, Stefan Nobis writes: > What about a third collection option 'none' and make this the default? A variant on this idea, would be to instead have the third collection option be 'default', which would stand for a language-specific default. For example, ":results default" could be

Re: Make ob-python.el support ":results pp" pretty print result

2020-02-22 Thread Jack Kamm
Hi stardiviner, stardiviner writes: > I found ob-python does not support ":results pp" pretty print result. And > Python > has a module "pprint". What about add support this? ":results pp" works for me, here's an example: > #+begin_src python :results pp > return globals() > #+end_src > >

Re: Bug or not a bug? dot expansion in ob-shell

2020-02-21 Thread Jack Kamm
Hi, Nick Dokos writes: >> That said, we have three solutions: >> >> 1. Stick to a strict reading of Org and bash manuals: the absence of a >>:results header means "return the value, i.e. the exit status". >> >> 2. Deviate from this strict reading, introduce an exception for *all* >>

Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-20 Thread Jack Kamm
Hi, Bastien writes: > Also, for included ob-*, the idea would be to use the mode that are > bundled with Emacs core. For Python, it would mean that ob-python.el > should support python.el, not python-mode.el. I agree that ob-python.el should only rely on functionality from python.el, and

Re: Make ob-python.el support ":results pp" pretty print result

2020-02-20 Thread Jack Kamm
Hi stardiviner, stardiviner writes: > I found ob-python does not support ":results pp" pretty print result. And > Python > has a module "pprint". What about add support this? Well, there is code in ob-python.el that uses the pprint module when ":results pp", but I must admit I've never used

Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-19 Thread Jack Kamm
Hi stardiviner, "numbch...@gmail.com" writes: > Yes, Jack, as Bastien said, you can format my commit, because my home > network is broken, I'm using Mobile Phone's 4G network to get online. Can't > get update immediately. OK, I've edited the commit message of your patch, and I also fixed the

Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread Jack Kamm
Hi stardiviner, Sorry for the noise, I have some additional comments below: When I run "make compile", I get the following message: In org-babel-python-initiate-session-by-key: ob-python.el:211:12:Warning: py-shell called with 9 arguments, but accepts only 0-1 I think this is because the

Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread Jack Kamm
Hi stardiviner, > This minor patch should fixed ~py-shell~ initiate Python session issue. It looks like this patch only affects users of python-mode.el. Since I don't use python-mode.el, I cannot test it. But the patch looks fine. Please add a commit message and changelog entry, and I'll merge

Re: [PATCH] (Tiny) Tweak Python session null return value

2020-02-17 Thread Jack Kamm
Hi John, John Kitchin writes: > I can see why you would want to see True/False there, but to get the value, > you need to specifically return what you want because AFAIK the body is > wrapped in a function that is evaluated to get the value, it is not simply > the last thing that gets

Re: [PATCH] (Tiny) Tweak Python session null return value

2020-02-17 Thread Jack Kamm
Hi Bastien, > I've seen you update the NEWS entry, which is good: is there a way to > present the enhancements in the "* New features" section? If you feel > like it, please advertize the enhancements there too. Given John's feedback, I now think it's better to put off this change to 9.5, if at

Re: [PATCH] (Tiny) Tweak Python session null return value

2020-02-17 Thread Jack Kamm
Hi John, John Kitchin writes: > I think None is correct. If you don't specify a return value in Python, > then a function returns None. I would expect that to happen in a Python > block too. Hmm, OK, thanks for your intuition, it's useful feedback. Working this out loud, I was considering the

Re: Bug: R src blocks fail to produce link to graphics file [9.3 org-plus-contrib-20200127]

2020-02-17 Thread Jack Kamm
Hi Tyler, >> The documentation for ob-R is now incorrect: >> >> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html > > Yes, also that page could use some other updates, e.g. there are some > dead links in there. Just saw that you updated the docs a few days ago. Thanks for

[PATCH] (Tiny) Tweak Python session null return value

2020-02-17 Thread Jack Kamm
ty) result instead of "None". [0] https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00190.html Best, Jack >From 0b44c3f1c7454e7948cd34eb02995924046b6976 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Mon, 17 Feb 2020 08:11:49 -0800 Subject: [PATCH] ob-python: Sessi

Re: org-babel strange html print in R

2020-02-11 Thread Jack Kamm
Hi, Jeremie Juste writes: > :results value html in the following code generates an error for me. > (Org mode version 9.2.3,R version 3.6.2). > but :results value output the "html" in an org-table format Hmm, I can confirm that ":session :results value html" is working for me, same as for

  1   2   >