[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] babel: ob-C with Visual C++ and compilation-mode
From: |
Ernesto Durante |
Subject: |
Re: [O] babel: ob-C with Visual C++ and compilation-mode |
Date: |
Fri, 15 Aug 2014 19:22:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) |
> Well... In this example, we go down from 9 lines to 7 lines. Ok fair.
> But the price is a new syntax to learn:
> ////main////
> Is it wise to add an org-mode specific syntax to C++ (which already has
> a lot) ?
>
> Being noisy is a weakness of C++.
> I think it is not the responsibility of org-mode to fix that.
>
> Now, org-mode is already able to process main()-less blocks in simple cases.
>
> #+BEGIN_SRC C++
> printf("hello\n");
> #+END_SRC
>
> If we can find a way to extend this feature to more cases,
> without needing a long documentation,
> then, sure, it would be a nice improvement.
I agree with you. Creating a new syntax is not a good idea.
However, in some way, ob-C has created a new syntax implicitly by
instantiating a new main in absence of such a function in the source
block.
So why not to extend this idea by allowing a user defined function to
parse the source block. The default function is clearly
org-babel-C-ensure-main-wrap.
We could create a new header :wrap which replaces :main and holds the user
defined function. It can take three values
nil, org-babel-C-ensure-main-wrap(default), or user-defined-function.
So, in this way user-defined-function holds my own syntax for my future
presentation.
What do you think ?
Best
Ernesto
- [O] babel: ob-C with Visual C++ and compilation-mode, Ernesto Durante, 2014/08/04
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Thierry Banel, 2014/08/11
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Ernesto Durante, 2014/08/12
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Thierry Banel, 2014/08/12
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Ernesto Durante, 2014/08/13
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Thierry Banel, 2014/08/14
- Re: [O] babel: ob-C with Visual C++ and compilation-mode,
Ernesto Durante <=
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Thierry Banel, 2014/08/17
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Ernesto Durante, 2014/08/18
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Thierry Banel, 2014/08/18
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Ernesto Durante, 2014/08/20
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Thierry Banel, 2014/08/21
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Ernesto Durante, 2014/08/24
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Thierry Banel, 2014/08/28
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Eric Schulte, 2014/08/21
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Ernesto Durante, 2014/08/24
- Re: [O] babel: ob-C with Visual C++ and compilation-mode, Eric Schulte, 2014/08/28