emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel][patch] C++ inconsistencies
@ 2011-02-18 10:58 Martyn Jago
  2011-02-18 16:36 ` Martyn Jago
  0 siblings, 1 reply; 9+ messages in thread
From: Martyn Jago @ 2011-02-18 10:58 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-23  4:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-18 10:58 [babel][patch] C++ inconsistencies Martyn Jago
2011-02-18 16:36 ` Martyn Jago
2011-02-20  8:25   ` Eric Schulte
2011-02-21 13:37     ` Martyn Jago
2011-02-21 17:10       ` Eric Schulte
2011-02-22 22:07         ` Martyn Jago
2011-02-23  4:21           ` Eric Schulte
2011-02-22 11:20       ` Bastien
2011-02-22 22:14         ` Martyn Jago

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).