emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] [babel][patch] C++ inconsistencies


From: Martyn Jago
Subject: [Orgmode] [babel][patch] C++ inconsistencies
Date: Fri, 18 Feb 2011 10:58:41 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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





reply via email to

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