[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [ob][bug] C++-mode is unknown
From: |
Eric Schulte |
Subject: |
Re: [O] [ob][bug] C++-mode is unknown |
Date: |
Sat, 13 Jul 2013 07:38:38 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
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 <address@hidden> 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
Re: [O] [ob][bug] C++-mode is unknown,
Eric Schulte <=