emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Leo Butler <Leo.Butler@umanitoba.ca>
Cc: tbanelwebmin <tbanelwebmin@free.fr>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] ob-C.el compile-only header argument, was Re: How to use mpirun with C or C++ Org-babel?
Date: Fri, 22 Dec 2023 12:20:41 +0000	[thread overview]
Message-ID: <877cl6l97q.fsf@localhost> (raw)
In-Reply-To: <87h6kdyh52.fsf_-_@t14.reltub.ca>

Leo Butler <Leo.Butler@umanitoba.ca> writes:

>> What will happen if we have something like :results value or :results
>> output instead of :results file link?
>
> Originally, I felt that only ":results file" makes sense. I have adopted
> your suggestion, though, and added test cases so that the compiler
> stderr output is caught.

Thanks! This makes sense, but now the default behaviour (when no :results
type is specified) is unexpected.

When you have something like

#+begin_src C :compile-only t :file foo :includes "stdio.h"
printf("This is test");
#+end_src

, executing should yield file link, even though it is not explicitly
specified.

And when you have compilation error,

#+begin_src C :compile-only t :file foo :includes "stdio.h"
printf("This is test")
#+end_src

the result may be empty - buffer displayed by `org-babel-eval' is
probably enough.

Basically, Org babel promises DWIM behavior when :results type is not
explicitly stated.

P.S. In my testing, I wrote

#+begin_src C :compile-only t :file foo :includes "stdio.h"
(printf "This is test")
#+end_src

and was staring at the compilation error for a good minute, trying to
understand what the hell did I do wrongly 🤦.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2023-12-22 12:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 23:10 How to use mpirun with C or C++ Org-babel? Edgar Lux
2023-12-08 10:36 ` tbanelwebmin
2023-12-08 15:47   ` Leo Butler
2023-12-08 22:24     ` Ihor Radchenko
2023-12-13 16:09       ` Leo Butler
2023-12-14 14:08         ` Ihor Radchenko
2023-12-19 22:14           ` [PATCH] ob-C.el compile-only header argument, was " Leo Butler
2023-12-22 12:20             ` Ihor Radchenko [this message]
2024-01-04 17:53               ` Leo Butler
2024-01-05 12:47                 ` Ihor Radchenko
2023-12-20 18:15           ` Leo Butler

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=877cl6l97q.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=Leo.Butler@umanitoba.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=tbanelwebmin@free.fr \
    /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).