From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Drechsler Subject: usage of bgein_src in 'Literal examples' section Date: Thu, 05 Jun 2008 00:21:05 +0200 Message-ID: <87tzg8n8oe.fsf@pdrechsler.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K41Ly-0006Zv-EN for emacs-orgmode@gnu.org; Wed, 04 Jun 2008 18:21:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K41Lw-0006YB-Sj for emacs-orgmode@gnu.org; Wed, 04 Jun 2008 18:21:10 -0400 Received: from [199.232.76.173] (port=36482 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K41Lw-0006Xt-Fs for emacs-orgmode@gnu.org; Wed, 04 Jun 2008 18:21:08 -0400 Received: from main.gmane.org ([80.91.229.2]:45159 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K41Lv-00018f-Mn for emacs-orgmode@gnu.org; Wed, 04 Jun 2008 18:21:08 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1K41Lo-0002Jy-2T for emacs-orgmode@gnu.org; Wed, 04 Jun 2008 22:21:00 +0000 Received: from dslb-088-065-072-165.pools.arcor-ip.net ([88.65.72.165]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jun 2008 22:21:00 +0000 Received: from patrick by dslb-088-065-072-165.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jun 2008 22:21:00 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, I like the new feature in "literal examples" using #+BEGIN_SRC ! But how do I find which mode Emacs is using for a certain file type? I could not figure out how to replace for simple C or CPP files. Here is a simple C file: --8<---------------cut here---------------start------------->8--- int main(void) { return 0; } --8<---------------cut here---------------end--------------->8--- I have tried different results from `M-x describe-mode' as well as stuff like: #+BEGIN_SRC c #+BEGIN_SRC c/law #+BEGIN_SRC cc #+BEGIN_SRC c-mode #+BEGIN_SRC cc-mode What is the correct to insert? The doc-string says this: ,---- | If the example is source code from a programming language, or any | other text that can be marked up by font-lock in Emacs, you can ask | for the example to look like the fontified Emacs buffer(1). This is | done with the `src' block, where you also need to specify the name of | the major mode that should be used to fontify the example: | | #+BEGIN_SRC emacs-lisp | (defun org-xor (a b) | "Exclusive or." | (if a (not b) b)) | #+END_SRC `---- Maybe it would be nice to add something along the lines of: --8<---------------cut here---------------start------------->8--- You can find out the Emacs mode corresponding to your source language by visiting a file in the particular mode and calling `M-x '. --8<---------------cut here---------------end--------------->8--- TIA Patrick -- An idea is like a cup of coffee, it's not going to stay hot forever.