From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: Bug: Proposed new version of ob-C.el [8.3beta (release_8.3beta-944-g830cf3 @ /Users/snapp/.emacs.d/vendor/org/)] Date: Mon, 30 Mar 2015 21:53:54 +0200 Message-ID: <5519A9D2.8020502@free.fr> References: <5166F4B8-A141-4968-B10E-4C25BDA72F5C@uvm.edu> <55186527.2080302@free.fr> <87wq1y35yn.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040807080109090306010109" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycfl2-0008GO-9g for emacs-orgmode@gnu.org; Mon, 30 Mar 2015 15:54:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycfky-0002G9-90 for emacs-orgmode@gnu.org; Mon, 30 Mar 2015 15:54:00 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:32268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycfky-0002G1-34 for emacs-orgmode@gnu.org; Mon, 30 Mar 2015 15:53:56 -0400 Received: from [IPv6:2a01:e35:2e21:def0:50f:5567:6918:defc] (unknown [IPv6:2a01:e35:2e21:def0:50f:5567:6918:defc]) by smtp5-g21.free.fr (Postfix) with ESMTP id 7F8C9D480CC for ; Mon, 30 Mar 2015 21:52:08 +0200 (CEST) In-Reply-To: <87wq1y35yn.fsf@alphaville.usersys.redhat.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------040807080109090306010109 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Ok, 100% of votes are for the removal of wired #includes. Here is the patch. Tests are changed accordingly. Thierry Le 30/03/2015 16:39, Nick Dokos a =E9crit : > > IMO, it would be better than the current situation, but I wonder if > it makes sense to have a global default setting containing the > three files, but one which the user can customize; any :includes > parameters would augment the default. > > That would satisfy the OP's requirements, but would also allow for > a shorter #+BEGIN_SRC line. > > Nick > > --------------040807080109090306010109 Content-Type: text/x-diff; name="0001-Remove-default-includes-in-Babel-C-C.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Remove-default-includes-in-Babel-C-C.patch" >From 89eab423a0084a715456db558a987d6d806c49ba Mon Sep 17 00:00:00 2001 From: Thierry Banel Date: Mon, 30 Mar 2015 21:36:00 +0200 Subject: [PATCH] Remove default #includes in Babel C, C++ * ob-C.el (org-babel-C-expand-C): remove automatic inclusion of , , * ob-C-test.org: adjust C++ tests to manually include required header files. --- lisp/ob-C.el | 1 - testing/examples/ob-C-test.org | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/ob-C.el b/lisp/ob-C.el index 0857795..8d5ff2f 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -194,7 +194,6 @@ it's header arguments." nil))) (when (stringp includes) (setq includes (split-string includes))) - (setq includes (append includes '("" "" ""))) (when (stringp defines) (let ((y nil) (result (list t))) diff --git a/testing/examples/ob-C-test.org b/testing/examples/ob-C-test.org index ab744f1..dcd1c48 100644 --- a/testing/examples/ob-C-test.org +++ b/testing/examples/ob-C-test.org @@ -129,7 +129,7 @@ | sunday | 4 | #+source: inhomogeneous_table -#+begin_src cpp :var tinomogen=tinomogen :results silent +#+begin_src cpp :var tinomogen=tinomogen :results silent :includes int main() { int i, j; -- 2.1.4 --------------040807080109090306010109--