unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* org-mode source blocks
@ 2010-12-21  8:09 Hill
  2010-12-21  9:36 ` Marco (m) Wahl
  0 siblings, 1 reply; 6+ messages in thread
From: Hill @ 2010-12-21  8:09 UTC (permalink / raw)
  To: help-gnu-emacs

I would like use the Source Code Blocks feature within org-mode. But I
found org-mode can't launch the language mode to edit the Source code.
1. Emacs -Q
2. M-x org-mode, then the emacs buffer entered the org-mode.
3. entering following test:
#+ srcname trait_demo.cpp
#+ begin_src c++
: using namespace std;
: int main( void )
: {
:   string tmp;
:   while(cin >> tmp)
:     {
:       cout << "from pipe: " << tmp << endl;
:     }
:
:
:   return 0;
: }
#+ end_src

4. C-c ' ;;then emacs lauch a buffer to edit the source code.
5. But the mode is "Picture" not c++ mode. Why?

I tried other language like python, it also launch a Picture-mode.
I would like to know. what's wrong?  My emacs version is 23.2.1 on
windows xp.

Any body can help? thanks!


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

* Re: org-mode source blocks
  2010-12-21  8:09 org-mode source blocks Hill
@ 2010-12-21  9:36 ` Marco (m) Wahl
  2010-12-21 16:36   ` Tassilo Horn
  0 siblings, 1 reply; 6+ messages in thread
From: Marco (m) Wahl @ 2010-12-21  9:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hill <zhubicen@gmail.com> writes:

> I would like use the Source Code Blocks feature within org-mode. But I
> found org-mode can't launch the language mode to edit the Source code.
> 1. Emacs -Q
> 2. M-x org-mode, then the emacs buffer entered the org-mode.
> 3. entering following test:
> #+ srcname trait_demo.cpp
> #+ begin_src c++
> : using namespace std;
> : int main( void )
> : {
> :   string tmp;
> :   while(cin >> tmp)
> :     {
> :       cout << "from pipe: " << tmp << endl;
> :     }
> :
> :
> :   return 0;
> : }
> #+ end_src
>
> 4. C-c ' ;;then emacs lauch a buffer to edit the source code.
> 5. But the mode is "Picture" not c++ mode. Why?
>
> I tried other language like python, it also launch a Picture-mode.
> I would like to know. what's wrong?  My emacs version is 23.2.1 on
> windows xp.
>
> Any body can help? thanks!

Hi Hill,

just remove the space after the "#+" in the lines starting with "#+".
E.g. use "#+begin_src c++" instead of "#+ begin_src c++".

Ciao
-- 
m


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

* Re: org-mode source blocks
  2010-12-21  9:36 ` Marco (m) Wahl
@ 2010-12-21 16:36   ` Tassilo Horn
  2010-12-21 16:51     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Tassilo Horn @ 2010-12-21 16:36 UTC (permalink / raw)
  To: help-gnu-emacs

marcowahl@gmail.com (Marco (m) Wahl) writes:

>> #+ srcname trait_demo.cpp
>> #+ begin_src c++
>> : using namespace std;
>> : int main( void )
>> : {
>> :   string tmp;
>> :   while(cin >> tmp)
>> :     {
>> :       cout << "from pipe: " << tmp << endl;
>> :     }
>> :
>> :
>> :   return 0;
>> : }
>> #+ end_src
>>
>> 4. C-c ' ;;then emacs lauch a buffer to edit the source code.
>> 5. But the mode is "Picture" not c++ mode. Why?
>>
>> I tried other language like python, it also launch a Picture-mode.
>> I would like to know. what's wrong?  My emacs version is 23.2.1 on
>> windows xp.
>>
>> Any body can help? thanks!
>
> Hi Hill,
>
> just remove the space after the "#+" in the lines starting with "#+".
> E.g. use "#+begin_src c++" instead of "#+ begin_src c++".

And I'm pretty sure that the code between the #+begin_src/end_src
markers should be put as-is, i.e., without leading :.

Bye,
Tassilo




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

* Re: org-mode source blocks
  2010-12-21 16:36   ` Tassilo Horn
@ 2010-12-21 16:51     ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2010-12-21 16:51 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: help-gnu-emacs

Tassilo Horn <tassilo@member.fsf.org> writes:

> And I'm pretty sure that the code between the #+begin_src/end_src
> markers should be put as-is, i.e., without leading :.

Yes, I confirm.

Here is a good resource for starting with Org Babel:

  http://orgmode.org/worg/org-contrib/babel/intro.php

-- 
 Bastien



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

* Re: org-mode source blocks
       [not found] <mailman.2.1292949627.3175.help-gnu-emacs@gnu.org>
@ 2010-12-22  1:31 ` Hill
  2010-12-22  6:35   ` Suvayu Ali
  0 siblings, 1 reply; 6+ messages in thread
From: Hill @ 2010-12-22  1:31 UTC (permalink / raw)
  To: gnu.emacs.help; +Cc: help-gnu-emacs

Thanks for all your replay.
It's ok now.
I also want to know is there a command I can use to insert these code blocks.
If then I don't need to manually enter these text like : "#+begin_src c++"

Thank you!



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

* Re: org-mode source blocks
  2010-12-22  1:31 ` Hill
@ 2010-12-22  6:35   ` Suvayu Ali
  0 siblings, 0 replies; 6+ messages in thread
From: Suvayu Ali @ 2010-12-22  6:35 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday 21 December 2010 05:31 PM, Hill wrote:
> Thanks for all your replay.
> It's ok now.
> I also want to know is there a command I can use to insert these code blocks.
> If then I don't need to manually enter these text like : "#+begin_src c++"
>

Type < s TAB. For more other such templates see the info node 
[[info:org:Easy%20Templates][info:org:Easy Templates]]

> Thank you!
>


-- 
Suvayu

Open source is the future. It sets us free.



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

end of thread, other threads:[~2010-12-22  6:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21  8:09 org-mode source blocks Hill
2010-12-21  9:36 ` Marco (m) Wahl
2010-12-21 16:36   ` Tassilo Horn
2010-12-21 16:51     ` Bastien
     [not found] <mailman.2.1292949627.3175.help-gnu-emacs@gnu.org>
2010-12-22  1:31 ` Hill
2010-12-22  6:35   ` Suvayu Ali

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