emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martyn Jago <martyn.jago@btinternet.com>
To: emacs-orgmode@gnu.org
Subject: [babel][patch] C++ inconsistencies
Date: Fri, 18 Feb 2011 10:58:41 +0000	[thread overview]
Message-ID: <87d3mpzk0u.fsf@btinternet.com> (raw)


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	other threads:[~2011-02-18 10:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18 10:58 Martyn Jago [this message]
2011-02-18 16:36 ` [babel][patch] C++ inconsistencies 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d3mpzk0u.fsf@btinternet.com \
    --to=martyn.jago@btinternet.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).