From: "Łukasz Stelmach" <lukasz.stelmach@iem.pw.edu.pl>
To: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-babel-perl and formats
Date: Fri, 09 Apr 2010 11:11:33 +0200 [thread overview]
Message-ID: <87r5mpyoqi.fsf@dasa3.iem.pw.edu.pl> (raw)
In-Reply-To: 8739z6djv5.fsf@stats.ox.ac.uk
Dan Davison <davison@stats.ox.ac.uk> writes:
> Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:
>> I am not sure I will be able to spend some time on this so I'll share my
>> observation with you. org-babel-perl can't cope with perl formats, with
>> their endings to be precise. A format is defined by:
>>
>> format FORMAT_NAME =
>> body of the format
>> .
>>
>> The problem is that formats *must* and with a single solitary dot or, to
>> be precise "\n.\n" sequence. org-babel-perl doesn't care about it and
>> puts "\t" befor the dot.
>
> Could you post an example? I don't believe we insert tab
> characters. I've never used a perl format before, but I just tried it
> and it seemed to work OK with C-c C-c:
>
> #+begin_src perl
> format STDOUT =
> @<<<<<< @|||||| @>>>>>>
> "left", "middle", "right"
> .
> write ;
> #+end_src
>
> #+results:
> : left middle right
With the very same code i get
--8<---------------cut here---------------start------------->8---
Format not terminated at - line 11, at end of line
syntax error at - line 11, at EOF
Execution of - aborted due to compilation errors.
--8<---------------cut here---------------end--------------->8---
while strace shows the code being wrapped
write(9, "\nsub main {\n\tformat STDOUT =\n\t@<<<<<< @|||||| @>>>>>>\n\t\"left\", \"middle\", \"right\"\n\t.\n\twrite ;\n}\n@r = main;\nopen(o, \">/tmp/perl-functional-results17170oCG\");\nprint o join(\"\\n\", @r), \"\\n\"", 184) = 184
inside something really odd:
--8<---------------cut here---------------start------------->8---
sub main {
format STDOUT =
@<<<<<< @|||||| @>>>>>>
"left", "middle", "right"
.
write ;
}
@r = main;
open(o, ">/tmp/perl-functional-results17170oCG");
print o join("\n", @r), "\n"
--8<---------------cut here---------------end--------------->8---
> Incidentally, do you know the variable org-src-preserve-indentation?
> When I first read your email I thought that would be the answer. In fact
> it doesn't seem to be relevant, but I thought I would mention it anyway.
Unfortunately it doesn't make any difference.
--
Miłego dnia,
Łukasz Stelmach
next prev parent reply other threads:[~2010-04-09 9:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 0:22 [BUG] org-babel-perl and formats Łukasz Stelmach
2010-04-08 15:50 ` Dan Davison
2010-04-09 9:11 ` Łukasz Stelmach [this message]
2010-04-09 13:21 ` Dan Davison
2010-04-09 20:53 ` Łukasz Stelmach
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=87r5mpyoqi.fsf@dasa3.iem.pw.edu.pl \
--to=lukasz.stelmach@iem.pw.edu.pl \
--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).