emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [ob][bug] C++-mode is unknown
Date: Sat, 13 Jul 2013 07:38:38 -0600	[thread overview]
Message-ID: <87ip0ey3z5.fsf@gmail.com> (raw)
In-Reply-To: <87ehb2fvsr.fsf@pank.lan> (rasmus@gmx.us's message of "Sat, 13 Jul 2013 15:12:36 +0200")

Use the `org-src-lang-modes' variable to associate a src code block name
with a major mode.  This list already contains ("cpp" . c++) for C++
code blocks, but perhaps ("C++" . c++) should be added as well.

Best,

Rasmus <rasmus@gmx.us> writes:

> Hi,
>
> The Emacs C++ mode is called c++-mode.  In babel C++ is C++.  
> Hence, the following problematic case holds. 
>
> With the block, (lowercase c)
>
>   #+begin_src c++ 
>    ...
>   #+end_src
>
> I can edit it in the c++-mode and get nice fontification, but I can't
> execute it.
>
> With (capital c)
>
>   #+begin_src C++ 
>    ...
>   #+end_src
>
> I can execute the block in Org, but I can't edit it in c++-mode.
>
> I'm not very knowledgeable about Babel, so the best fix I could find
> was adding
>
>   (defalias 'C++-mode 'c++-mode)
>
> to the top of ob-c.el (after requiring cc-mode).  Of course C++ could
> also be renamed c++, but the correct name does in fact seem to use
> capitals (cf. Wikipedia).
>
> Ob-template didn't mention how to associate a language with a given
> mode.
>
> Cheers,
> Rasmus

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  parent reply	other threads:[~2013-07-13 13:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-13 13:12 [ob][bug] C++-mode is unknown Rasmus
2013-07-13 13:23 ` Rasmus
2013-07-13 21:53   ` export to markdown Rill
2013-07-13 22:08     ` Suvayu Ali
     [not found]       ` <51E1D61E.9050502@yahoo.com>
2013-07-14  7:49         ` Suvayu Ali
2013-07-14 17:35           ` Rill
2013-07-13 13:38 ` Eric Schulte [this message]
2013-07-13 14:41   ` [ob][bug] C++-mode is unknown Rasmus
2013-07-13 17:59     ` Rasmus
2013-07-13 18:39       ` Eric Schulte
2013-07-13 18:59         ` Rasmus

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=87ip0ey3z5.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).