From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [ob][bug] C++-mode is unknown Date: Sat, 13 Jul 2013 07:38:38 -0600 Message-ID: <87ip0ey3z5.fsf@gmail.com> References: <87ehb2fvsr.fsf@pank.lan> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uy043-0006AD-Tv for emacs-orgmode@gnu.org; Sat, 13 Jul 2013 09:40:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uy042-0001HX-Ks for emacs-orgmode@gnu.org; Sat, 13 Jul 2013 09:40:43 -0400 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:64660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uy042-0001HO-EA for emacs-orgmode@gnu.org; Sat, 13 Jul 2013 09:40:42 -0400 Received: by mail-pb0-f52.google.com with SMTP id xa12so9781065pbc.39 for ; Sat, 13 Jul 2013 06:40:41 -0700 (PDT) In-Reply-To: <87ehb2fvsr.fsf@pank.lan> (rasmus@gmx.us's message of "Sat, 13 Jul 2013 15:12:36 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org 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 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