emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] babel: ob-C with Visual C++ and compilation-mode


From: Thierry Banel
Subject: Re: [O] babel: ob-C with Visual C++ and compilation-mode
Date: Sun, 17 Aug 2014 13:20:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

Le 15/08/2014 19:22, Ernesto Durante a écrit :
> 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.

True.
And to achieve that the :includes header tag was added:
#+BEGIN_SRC C++ :includes <stdio.h>

(Because otherwise a #include statement would end up in the main() function)

For me this is already a questionable distortion of C++.

The Emacs C++-mode does no attempt at hiding parts of a C++ file.
It just display the file as it is, and that is good.

> 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 ?
>

This is far too complex for me.
I will just write down the main() function rather than learning this
extension.

But of course, I am just one user among others.
You are another user and you feel the need for this extension,
and this should be taken into account.
Try the extension for yourself, then share it, and see if others like it.

Thanks for all the ideas you submitted.
Please stay involved.
Thierry







reply via email to

[Prev in Thread] Current Thread [Next in Thread]