From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martyn Jago Subject: [babel][patch] C++ inconsistencies Date: Fri, 18 Feb 2011 10:58:41 +0000 Message-ID: <87d3mpzk0u.fsf@btinternet.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=55219 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqO37-0004LW-Rc for emacs-orgmode@gnu.org; Fri, 18 Feb 2011 05:59:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqO36-0005Kr-Bd for emacs-orgmode@gnu.org; Fri, 18 Feb 2011 05:58:57 -0500 Received: from lo.gmane.org ([80.91.229.12]:55321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqO36-0005Jw-5W for emacs-orgmode@gnu.org; Fri, 18 Feb 2011 05:58:56 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PqO33-0000Il-8a for emacs-orgmode@gnu.org; Fri, 18 Feb 2011 11:58:53 +0100 Received: from 88-96-171-142.dsl.zen.co.uk ([88.96.171.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Feb 2011 11:58:53 +0100 Received: from martyn.jago by 88-96-171-142.dsl.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Feb 2011 11:58:53 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi I've noticed a couple of minor inconsistencies with C++ export... - According to the Org manual (section 14.7 Languages) the identifier for C++ is C++ (upper-case), but in practice this fails and the identifier c++ (lower-case) must be used. In general, identifiers appear to be lower-case words or upper-case single characters (such as C and R) so perhaps this is a bug? - Within org-babel cpp is used to identify C++, however using cpp as an identifier actually exports as if it were a C block. If it is desired the following patch changes the C++ identifier to C++, and maps cpp identifier also to C++, although perhaps it is better to maintain c++ also for backward compatibility? Regards Martyn diff --git a/lisp/ob-C.el b/lisp/ob-C.el index da0e768..86ec783 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -56,10 +56,10 @@ is currently being evaluated.") (defun org-babel-execute:cpp (body params) "Execute BODY according to PARAMS. This function calls -`org-babel-execute:C'." - (org-babel-execute:C body params)) +`org-babel-execute:C++'." + (org-babel-execute:C++ body params)) -(defun org-babel-execute:c++ (body params) +(defun org-babel-execute:C++ (body params) "Execute a block of C++ code with org-babel. This function is called by `org-babel-execute-src-block'." (let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params))) --- Org-mode version 7.4 GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0) of 2011-02-18