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

2014-08-28 Thread Eric Schulte
Ernesto Durante stobos...@gmail.com writes: Eric Schulte schulte.e...@gmail.com writes: Ernesto Durante stobos...@gmail.com writes: Perhaps a new header argument should be added for C-Family languages which will inhibit this main wrapping behavior? -- Eric Hi Eric, According to me, we

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

2014-08-28 Thread Thierry Banel
Le 24/08/2014 14:57, Ernesto Durante a écrit : I have worked with VTK (the visualization toolkit). It is like babel and allows differents block to be chained and evaluated on demand. Very interesting software. Thanks for sharing.

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

2014-08-24 Thread Ernesto Durante
Thierry Banel tbanelweb...@free.fr writes: Le 20/08/2014 22:40, Ernesto Durante a écrit : as the source org file is not guarantied to be in utf-8. You may want to give it a try an provide a patch for that. 3 files are involved: - lisp/ob-C.el (you know this one) -

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

2014-08-24 Thread Ernesto Durante
Eric Schulte schulte.e...@gmail.com writes: Ernesto Durante stobos...@gmail.com writes: Perhaps a new header argument should be added for C-Family languages which will inhibit this main wrapping behavior? -- Eric Hi Eric, According to me, we can already inhibit the wrapping with the

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

2014-08-23 Thread Ernesto Durante
Eric Schulte schulte.e...@gmail.com writes: Hi Ernesto, This looks like a good change and I'd like to apply it. Could you re-submit this commit after doing the following. 1. ensure no lines go beyond 80 characters in length 2. remove all lines which include only closing parens (such

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

2014-08-21 Thread Thierry Banel
Le 20/08/2014 22:40, Ernesto Durante a crit: Another question if you allow me ? Looking at code in Ob-C you transform a table/list variable in a C array of char*. Should it not be std::wstring ? some unicode string ? Best Ernesto Absolutely!

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

2014-08-21 Thread Eric Schulte
Hi Ernesto, This looks like a good change and I'd like to apply it. Could you re-submit this commit after doing the following. 1. ensure no lines go beyond 80 characters in length 2. remove all lines which include only closing parens (such lines are generally considered bad lisp style) 3.

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

2014-08-21 Thread Eric Schulte
Ernesto Durante stobos...@gmail.com writes: Thierry Banel tbanelweb...@free.fr writes: I have identified a minor bug. When a source code block has the mode cpp, we cannot expand the code or more precisely the code is not expanded in the correct way because the following function is missing

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

2014-08-21 Thread Eric Schulte
Ernesto Durante stobos...@gmail.com writes: Thierry Banel tbanelweb...@free.fr writes: Le 15/08/2014 19:22, Ernesto Durante a écrit : 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

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

2014-08-20 Thread Ernesto Durante
Thierry Banel tbanelweb...@free.fr writes: You are trying to create a C++ project bigger than a few lines, in Org-mode. This is very close to the idea of literate programming from Donal Knuth. You may find inspiration here:

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

2014-08-18 Thread Ernesto Durante
Thierry Banel tbanelweb...@free.fr writes: Le 15/08/2014 19:22, Ernesto Durante a écrit : 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

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

2014-08-18 Thread Thierry Banel
Le 18/08/2014 13:19, Ernesto Durante a écrit : I think the problem we are trying to integrate C++/C like Lisp,Python,Haskell or programming languages which can rely on a session to share their content. In a way, the idea of Babel originated from such a session

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

2014-08-17 Thread Thierry Banel
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

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

2014-08-15 Thread Ernesto Durante
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

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

2014-08-14 Thread Thierry Banel
Le 13/08/2014 22:58, Ernesto Durante a écrit : Thank you Thierry for your answer and all the details. I really want to be a contributor and help ob-C to improve (as well as can do a modest lisper). Any help is welcome ! I tried to find a way to master Cx11 and babel is helping me a lot. I

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

2014-08-13 Thread Ernesto Durante
Thierry Banel tbanelweb...@free.fr writes: I have identified a minor bug. When a source code block has the mode cpp, we cannot expand the code or more precisely the code is not expanded in the correct way because the following function is missing (defun org-babel-expand-body:cpp (body

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

2014-08-12 Thread Ernesto Durante
Thierry Banel tbanelweb...@free.fr writes: Le 04/08/2014 18:16, Ernesto Durante a écrit : One suggestion. It will be nice to put the error buffer in compilation-mode, this way errors are highlighted and we can jump directly into the source code. I modified org-babel-eval to launch the

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

2014-08-12 Thread Thierry Banel
Le 12/08/2014 16:24, Ernesto Durante a écrit : Hi Thierry, Thanks you but I don't know who is responsible to apply the patch. I have been in touch with Eric Schulte and Bastien Guerry who are both maintainers. Probably Eric is the right person, as he is very involved in all Babel subjects. I

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

2014-08-11 Thread Thierry Banel
Le 04/08/2014 18:16, Ernesto Durante a écrit : One suggestion. It will be nice to put the error buffer in compilation-mode, this way errors are highlighted and we can jump directly into the source code. I modified org-babel-eval to launch the compilation mode in case of errors. I also removed

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

2014-08-04 Thread Ernesto Durante
Hi, I am using ob-C with gcc and Microsoft Visual C++. These two compilers have two different behaviours for outputting errors. Gcc uses the standard error output and Visual C++ uses the regular output. Under Windows, errors are not displayed because of the way org-babel-eval is coded. To work