From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: evaluate cpp snippet in org babel with default includes and customized entry point Date: Sat, 16 Sep 2017 11:05:57 +0200 Message-ID: <59BCE975.9000906@free.fr> References: <877ewz9j4x.fsf@gmail.com> <59BCE1F6.3060406@free.fr> <8760cj9gz2.fsf@gmail.com> <59BCE6DA.80907@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dt932-0003Y3-B0 for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dt931-0005oZ-Hh for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:06:00 -0400 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]:55976) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dt931-0005nW-BS for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:05:59 -0400 Received: from [IPv6:2a01:e35:2e21:def0:351e:772c:a55d:35db] (unknown [IPv6:2a01:e35:2e21:def0:351e:772c:a55d:35db]) by smtp2-g21.free.fr (Postfix) with ESMTP id CD70A2003D6 for ; Sat, 16 Sep 2017 11:05:57 +0200 (CEST) In-Reply-To: <59BCE6DA.80907@free.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org You may further hide the includes with a property drawer. An additional benefit is that those includes are shared among all babels under the same section. * Example :PROPERTIES: :includes: :END: #+BEGIN_SRC C++ std::cout<<"hello"; #+END_SRC #+RESULTS: : hello On 16/09/2017 10:54, Thierry Banel wrote: > You may use the :includes header parameter. > > Also, you may omit the main() function. In this case, all your code > will become the body of a default main function. Type C-c C-v v on the > following example to understand what is happening. > > > #+BEGIN_SRC C++ :includes > std::cout<<"hello"; > #+END_SRC > > #+RESULTS: > : hello > > > On 16/09/2017 10:37, Amos Bird wrote: >> >> Thanks Thierry, >> >> But I'd like to hide all those includes and the main function. I'm >> not sure if it's possible. >> >> > > >