* Orgmode + other modes for outlining and studying.
@ 2010-01-07 23:21 Marcelo de Moraes Serpa
2010-01-08 0:07 ` Manish
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Marcelo de Moraes Serpa @ 2010-01-07 23:21 UTC (permalink / raw
To: Org Mode
[-- Attachment #1.1: Type: text/plain, Size: 740 bytes --]
Hello guys,
Orgmode files are great for studying, for example, code.
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?
Thanks in advance,
Marcelo Serpa.
[-- Attachment #1.2: Type: text/html, Size: 803 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Orgmode + other modes for outlining and studying.
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 8:49 ` Sébastien Vauban
2 siblings, 0 replies; 11+ messages in thread
From: Manish @ 2010-01-08 0:07 UTC (permalink / raw
To: Marcelo de Moraes Serpa; +Cc: Org Mode
On Fri, Jan 8, 2010 at 4:51 AM, Marcelo de Moraes Serpa wrote:
> Hello guys,
>
> Orgmode files are great for studying, for example, code.
>
> 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?
have you seen this http://www.emacswiki.org/emacs/mumamo ?
hth
--
manish
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Orgmode + other modes for outlining and studying.
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 8:49 ` Sébastien Vauban
2 siblings, 1 reply; 11+ messages in thread
From: Eric Schulte @ 2010-01-08 0:21 UTC (permalink / raw
To: Marcelo de Moraes Serpa; +Cc: Org Mode
Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:
>
> Is there a way to have two major modes at the same time, such as org + js-mode?
>
yes, but it will be buggy, see
http://article.gmane.org/gmane.emacs.orgmode/8112/
-- Eric
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Orgmode + other modes for outlining and studying.
2010-01-08 0:21 ` Eric Schulte
@ 2010-01-08 0:27 ` Greg Newman
2010-01-08 3:25 ` [Orgmode] " Eric Schulte
0 siblings, 1 reply; 11+ messages in thread
From: Greg Newman @ 2010-01-08 0:27 UTC (permalink / raw
To: Eric Schulte; +Cc: Org Mode
[-- Attachment #1.1: Type: text/plain, Size: 628 bytes --]
what about mmm mode? Anyone try it with org?
http://mmm-mode.sourceforge.net/
On Thu, Jan 7, 2010 at 7:21 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:
>
> >
> > Is there a way to have two major modes at the same time, such as org +
> js-mode?
> >
>
> yes, but it will be buggy, see
>
> http://article.gmane.org/gmane.emacs.orgmode/8112/
>
> -- Eric
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
[-- Attachment #1.2: Type: text/html, Size: 1389 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Orgmode] Orgmode + other modes for outlining and studying.
2010-01-08 0:27 ` Greg Newman
@ 2010-01-08 3:25 ` Eric Schulte
0 siblings, 0 replies; 11+ messages in thread
From: Eric Schulte @ 2010-01-08 3:25 UTC (permalink / raw
To: Greg Newman; +Cc: mmm-mode-discuss, Org Mode, Marcelo de Moraes Serpa
I tried to implement mmm-mode support for org-mode source code blocks
following the sample recipes provided along with the mmm-mode source.
These efforts were met with almost no success.
using this org-mode buffer http://gist.github.com/271820
and this mmm-mode activation code http://gist.github.com/271822
I was able to get a block of css code to fontify from within an org-mode
buffer-- for some unknown reason I was not able to highlight blocks of
ruby or emacs-lisp code.
I fear the "one major mode per buffer" assumption is deeply embedded in
Emacs and *any* such solution will probably end up being buggy.
Best -- Eric
Greg Newman <greg@20seven.org> writes:
> what about mmm mode? Anyone try it with org?
> http://mmm-mode.sourceforge.net/
>
> On Thu, Jan 7, 2010 at 7:21 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>
> Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:
>
> >
> > Is there a way to have two major modes at the same time, such as org + js-mode?
> >
>
> yes, but it will be buggy, see
>
> http://article.gmane.org/gmane.emacs.orgmode/8112/
>
> -- Eric
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Orgmode + other modes for outlining and studying.
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 8:49 ` Sébastien Vauban
2010-01-08 16:05 ` Thomas S. Dye
2 siblings, 1 reply; 11+ messages in thread
From: Sébastien Vauban @ 2010-01-08 8:49 UTC (permalink / raw
To: emacs-orgmode-mXXj517/zsQ
Hi Marcelo,
Marcelo de Moraes Serpa wrote:
> Orgmode files are great for studying, for example, code.
>
> 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.
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Re: Orgmode + other modes for outlining and studying.
2010-01-08 8:49 ` Sébastien Vauban
@ 2010-01-08 16:05 ` Thomas S. Dye
2010-01-09 20:38 ` Sébastien Vauban
0 siblings, 1 reply; 11+ messages in thread
From: Thomas S. Dye @ 2010-01-08 16:05 UTC (permalink / raw
To: Sébastien Vauban; +Cc: emacs-orgmode
Hi Seb and Marcelo,
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. 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?
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.
All the best,
Tom
On Jan 7, 2010, at 10:49 PM, Sébastien Vauban wrote:
> Hi Marcelo,
>
> Marcelo de Moraes Serpa wrote:
>> Orgmode files are great for studying, for example, code.
>>
>> 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.
>
> Best regards,
> Seb
>
> --
> Sébastien Vauban
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Orgmode + other modes for outlining and studying.
2010-01-08 16:05 ` Thomas S. Dye
@ 2010-01-09 20:38 ` Sébastien Vauban
2010-01-09 21:22 ` Eric Schulte
0 siblings, 1 reply; 11+ messages in thread
From: Sébastien Vauban @ 2010-01-09 20:38 UTC (permalink / raw
To: emacs-orgmode-mXXj517/zsQ
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Re: Orgmode + other modes for outlining and studying.
2010-01-09 20:38 ` Sébastien Vauban
@ 2010-01-09 21:22 ` Eric Schulte
2010-01-09 22:52 ` Thomas S. Dye
0 siblings, 1 reply; 11+ messages in thread
From: Eric Schulte @ 2010-01-09 21:22 UTC (permalink / raw
To: Sébastien Vauban; +Cc: emacs-orgmode
Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
[...]
>>> And, to work on that source block, just hit C-c C-c when point is in the
>>> block.
Correction: hit C-c ' to edit a source block in it's major mode
>>
>> 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.
>
The editing of source-code blocks is a feature of the Org-mode so it
will work regardless of whether or not a particular language (e.g. java)
is supported by Org-babel.
Best -- Eric
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Re: Orgmode + other modes for outlining and studying.
2010-01-09 21:22 ` Eric Schulte
@ 2010-01-09 22:52 ` Thomas S. Dye
2010-01-10 15:46 ` Eric Schulte
0 siblings, 1 reply; 11+ messages in thread
From: Thomas S. Dye @ 2010-01-09 22:52 UTC (permalink / raw
To: Eric Schulte; +Cc: Sébastien Vauban, emacs-orgmode
Aloha all,
On Jan 9, 2010, at 11:22 AM, Eric Schulte wrote:
> Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
>
> [...]
>
>>>> And, to work on that source block, just hit C-c C-c when point is
>>>> in the
>>>> block.
>
> Correction: hit C-c ' to edit a source block in it's major mode
>
>>>
>>> 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.
>>
>
> The editing of source-code blocks is a feature of the Org-mode so it
> will work regardless of whether or not a particular language (e.g.
> java)
> is supported by Org-babel.
>
> Best -- Eric
>
What would it take to add AWK to the list of supported languages, in
addition to Seb's setup?
Tom
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Re: Orgmode + other modes for outlining and studying.
2010-01-09 22:52 ` Thomas S. Dye
@ 2010-01-10 15:46 ` Eric Schulte
0 siblings, 0 replies; 11+ messages in thread
From: Eric Schulte @ 2010-01-10 15:46 UTC (permalink / raw
To: Thomas S. Dye; +Cc: Sébastien Vauban, emacs-orgmode
"Thomas S. Dye" <tsd@tsdye.com> writes:
[..]
>
> What would it take to add AWK to the list of supported languages, in
> addition to Seb's setup?
>
It is currently possible to run awk one-liners using a shell script
block, but I guess awk does straddle the line between command-line
command and full-fledged language.
It would be possible to add support for awk as a language by fleshing
out the org-babel-template.el [1] following the directions in that file
itself. All of the *session* functions can be ignored (as I don't think
there is such a thing as an interactive awk session) which makes this
task relatively simple. Another good guide could be org-babel-ditaa.el
[2] which is also a fairly simple language.
Best -- Eric
Footnotes:
[1] http://github.com/eschulte/babel-dev/raw/master/org-babel-template.el
[2] http://repo.or.cz/w/org-mode.git/blob_plain/HEAD:/contrib/babel/lisp/langs/org-babel-ditaa.el
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-01-10 15:46 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-01-09 21:22 ` Eric Schulte
2010-01-09 22:52 ` Thomas S. Dye
2010-01-10 15:46 ` Eric Schulte
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.