emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Konovalov <aragaer@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]
Date: Tue, 12 Mar 2024 12:27:46 +0300	[thread overview]
Message-ID: <87il1rn6fn.fsf@gmail.com> (raw)
In-Reply-To: <87plw3jh5c.fsf@gmail.com>


After some usage I found that this exact patch breaks
`org-babel-import-elisp-from-file's own separator detection. It looks
like it's better to leave it as `nil' unless specified.

Ilya Konovalov <aragaer@gmail.com> writes:

> On current master using ":sep" header argument does not work as
> expected and records are always split on whitespaces. For example:
>
> #+begin_src sh :sep "\t"
>   echo hello world
>   echo test
> #+end_src
>
> #+RESULTS:
> | hello | world |
> | test  |       |
>
> It looks like the issue is in the org-babel-sh-evaluate function, where
> at the end it passes the result to the org-babel-import-elist-from-file
> function for processing. Replacing the code with the following seems to
> fix the issue:
>
> (let ((tmp-file (org-babel-temp-file "sh-"))
>       (sep (or (cdr (assq :sep params)) "\t")))
>   (with-temp-file tmp-file (insert results))
>   (org-babel-import-elisp-from-file tmp-file sep))
>
> Emacs  : GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, X toolkit)
>  of 2024-03-02
> Package: Org mode version 9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)



  reply	other threads:[~2024-03-12  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 20:15 [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)] Ilya Konovalov
2024-03-12  9:27 ` Ilya Konovalov [this message]
2024-03-12 10:22   ` Matt
2024-03-12 10:41     ` Ilya Konovalov
2024-03-12 14:25     ` Ihor Radchenko
2024-03-12 14:38 ` 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=87il1rn6fn.fsf@gmail.com \
    --to=aragaer@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).