[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] usage of bgein_src in 'Literal examples' section

From: Patrick Drechsler
Subject: [Orgmode] usage of bgein_src in 'Literal examples' section
Date: Thu, 05 Jun 2008 00:21:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)


I like the new feature in "literal examples" using #+BEGIN_SRC <mode>!

But how do I find which mode Emacs is using for a certain file type?

I could not figure out how to replace <mode> 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

#+BEGIN_SRC c/law
#+BEGIN_SRC c-mode
#+BEGIN_SRC cc-mode

What is the correct <mode> 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 <describe?-???>'.

--8<---------------cut here---------------end--------------->8---


An idea is like a cup of coffee, it's not going to stay hot forever.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]