emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Orgmode + other modes for outlining and studying.
Date: Sat, 09 Jan 2010 21:38:03 +0100	[thread overview]
Message-ID: <87vdfb10b8.fsf@mundaneum.com> (raw)
In-Reply-To: F1B99325-5B59-49F0-A9FD-7E6FECF5CBF6@tsdye.com

Hi Thomas and Marcelo,

>>> Everytime I need to study some unknown code, I create a new org file, put a
>>> * Code headline, paste the code in there and start making notes below or
>>> in the code (as comments). It is extremelly fast and efficient to do something
>>> like that, things just flow.
>>>
>>> What I'd like to know is if there's a way to have, for example, orgmode +
>>> javascript-mode, so that I can get syntax-highlighting/coloring on the
>>> pasted javascript code. I've tried with javascript mode, but since it is a
>>> major mode, it just kills org and all its goodies, and I don't want that.
>>>
>>> Is there a way to have two major modes at the same time, such as org +
>>> js-mode?
>>
>> Are you aware of Org-babel's SRC blocks?
>>
>> #+BEGIN_SRC java
>> bla bla
>> #+END_SRC
>>
>> And, to work on that source block, just hit C-c C-c when point is in the
>> block.
>
> Currently, java isn't on the list of Org-babel supported languages, so I
> don't know if Seb's solution will work out of the box.

Did not know that. Not using it myself.


> Org-babel has a facility for adding new language support. A java addition
> would be great. Seb, if you have this working could you share your approach?

Yes, you can easily add new languages. I did that for AWK:

--8<---------------cut here---------------start------------->8---
;; Org-babel needs to be told to recognize awk source code blocks and
;; how they should be tangled, which can be accomplished with the
;; following:
(org-babel-add-interpreter "awk")
(add-to-list 'org-babel-tangle-langs '("awk" "awk"))
--8<---------------cut here---------------end--------------->8---

I guess replacing awk by java would make it. Untested, though, as I don't use
it.


> I agree with Seb that Org-babel is useful in the situation that Marcelo
> describes. I use it this way myself with python. Comments are distinguished
> from code very cleanly. In effect, you end up with a literate program.

I guess this is the best thing to do, yes. Thanks for your comment (and
support), Thomas!

Best regards,
  Seb

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-01-09 20:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 23:21 Orgmode + other modes for outlining and studying Marcelo de Moraes Serpa
2010-01-08  0:07 ` Manish
2010-01-08  0:21 ` Eric Schulte
2010-01-08  0:27   ` Greg Newman
2010-01-08  3:25     ` [Orgmode] " Eric Schulte
2010-01-08  8:49 ` Sébastien Vauban
2010-01-08 16:05   ` Thomas S. Dye
2010-01-09 20:38     ` Sébastien Vauban [this message]
2010-01-09 21:22       ` Eric Schulte
2010-01-09 22:52         ` Thomas S. Dye
2010-01-10 15:46           ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vdfb10b8.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).