From: Matt <matt@excalamus.com>
To: "Osher Jacob" <osherz5@gmail.com>
Cc: "ihor radchenko" <yantar92@posteo.net>,
"emacs-orgmode" <emacs-orgmode@gnu.org>
Subject: Re: [BUG] ob-shell doesn't evaluate last line on Windows (cmd/cmdproxy) [9.6.1 ( @ c:/Users/Osher/AppData/Roaming/.emacs.d/elpa/org-9.6.1/)]
Date: Thu, 19 Jan 2023 23:29:52 -0500 [thread overview]
Message-ID: <185cd70ae39.f63b9940267772.3953346328326599863@excalamus.com> (raw)
In-Reply-To: <CAGsxwFbwL_BXd82pyhpNYdiswCYZ9xDRgq2xCc1icFfZxwbX8Q@mail.gmail.com>
---- On Thu, 19 Jan 2023 11:28:09 -0500 Osher Jacob wrote ---
> If we're insistent on passing the input through the command line arguments, I can think of two ways to go about this, but both seem undesirable
They're good ideas and, I agree, aren't ideal.
> I think it could be enough to make sure the input ends with a newline, in which case it could be done the way I proposed in the first message, that is changing:(t (org-babel-eval shell-file-name (org-trim body))))))
> to(t (org-babel-eval shell-file-name (concat (org-trim body) "\n"))))))
Your original proposal was reasonable and looks even more so now.
> I think as long as this change doesn't break the code in non-Windows operating systems (How would we go about verifying this?), it would be preferable due to its simplicity and minimality.
Agreed, I like its simplicity. Tests are a first step and they all pass with your suggested change.
> If for any other reason you would rather not change the org-babel-sh-evaluate, and would like to implement a separate function for Windows, that's also a viable option.I am willing to try and go down that path, although I'm not a very experienced lisper.
> Do any of these options sound like they could work well?
I agree, putting in the newline is simple and it would be easy enough to create a separate path for Windows/cmd if it were a problem.
I wonder if it might make sense to move where the trimming happens so that the body passed into `org-babel-sh-evaluate' is ready to go and we could handle the cmd case separately and earlier (by inserting the newline there)?
I appreciate you taking the time to explore and for being open to what feels like me over-thinking it :)
I'll be away from the keyboard for a few days and I look forward to getting this wrapped up for you. Meanwhile, I'm curious if Ihor or others have advice.
next prev parent reply other threads:[~2023-01-20 4:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 16:27 [BUG] ob-shell doesn't evaluate last line on Windows (cmd/cmdproxy) [9.6.1 ( @ c:/Users/Osher/AppData/Roaming/.emacs.d/elpa/org-9.6.1/)] Osher Jacob
2023-01-16 21:40 ` Matt
2023-01-17 1:07 ` Matt
2023-01-17 19:53 ` Osher Jacob
2023-01-18 5:09 ` Matt
2023-01-18 9:05 ` Ihor Radchenko
2023-01-19 16:28 ` Osher Jacob
2023-01-20 4:29 ` Matt [this message]
2023-01-20 9:27 ` Ihor Radchenko
2023-01-23 3:12 ` Matt
2023-01-23 11:42 ` Ihor Radchenko
2023-01-26 4:04 ` Matt
2023-01-26 9:51 ` Ihor Radchenko
2023-01-30 6:00 ` Matt
2023-01-30 14:00 ` Ihor Radchenko
2023-01-30 17:08 ` Matt
2023-02-01 12:05 ` Ihor Radchenko
2023-02-01 20:21 ` Matt
2023-01-20 9:24 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=185cd70ae39.f63b9940267772.3953346328326599863@excalamus.com \
--to=matt@excalamus.com \
--cc=emacs-orgmode@gnu.org \
--cc=osherz5@gmail.com \
--cc=yantar92@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).