emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* usage of bgein_src in 'Literal examples' section
@ 2008-06-04 22:21 Patrick Drechsler
  2008-06-05  0:30 ` Bernt Hansen
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Drechsler @ 2008-06-04 22:21 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

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
like:

#+BEGIN_SRC c
#+BEGIN_SRC c/law
#+BEGIN_SRC cc
#+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---

TIA

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-07 13:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-04 22:21 usage of bgein_src in 'Literal examples' section Patrick Drechsler
2008-06-05  0:30 ` Bernt Hansen
2008-06-05  1:40   ` Patrick Drechsler
2008-06-05  1:58     ` Bernt Hansen
2008-06-06 10:39       ` Patrick Drechsler
2008-06-06 11:27         ` Dominik, C.
2008-06-07 13:44           ` Patrick Drechsler

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).