emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Embedding org-syntax in program source


From: Eric Schulte
Subject: Re: [Orgmode] Embedding org-syntax in program source
Date: Tue, 13 Apr 2010 10:47:15 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

LanX <address@hidden> writes:

> Oops, forgot to reply to the list... 8-| ..
>
> ---------- Forwarded message ----------
>
> Thanks Eric,
>
>
> see this thread http://thread.gmane.org/gmane.emacs.orgmode/7957, as I
>> recall basically it's possible to get most org-like behavior using
>> orgstruct-mode, but many are continually frustrated by the remaining
>> missing 20% of behavior.
>>
>
> Hmm, for what I read it's NOT easily possible, Tassilo switched back to
> outline-minor-mode.
>
>
>
>>
>> > I know of org-babel, but the code produced is no legal Lisp/Perl code
>> > anymore...
>>
>> could you please elaborate,
>> ...
>>
>> I'm currently using Org-babel to write code in a variety of programming
>> languages, and I've had no problems running the tangled code.
>>
>
> Thats the point you have to tangle the code and furthermore you have to run
> emacs to tangle it.
>
> The file as such is not a legal Perl code anymore because of lines starting
> with a "*".
> (never actually worked with babel, but thats what I read from the docs)
>

Ah, I see, I was worried that you were having a problem with tangling.
Maybe there is some way to hide the org-mode wrappings with "heredoc"
style lines (I'm not very familiar with perl, but I hear it is very
flexible about the syntax in source-code files).  Maybe something like

  =for comment

  org-mode text

  * headlines

  etc...

  #+begin_src perl
  =cut

  =for comment
  #+end_src

  more org-mode...

>
> And relying on an extra step for code generation is dangerous...
>
> This is for sure acceptable with elisp or multilanguage projects.
>

Certainly tangling is an extra step, and as a matter of taste not
something many people will want to use, but I wouldn't say it's
dangerous.  I tangle in a couple of very real very large single-language
projects (sometimes with the same code tangling to run on different
platforms) and find it reliable.

>
> Anyway I think, I will do some experiments with using a Code Filter in
>Perl
> which eliminates the org-code. (thats a filter run at execution-time
> changing the source before it's fed into the compiler)
>

Good luck, if you find a workable solution, I'm sure there'd be interest
to hear about it here.

Best -- Eric

>
> Cheers
>   Rolf
>
> PS: I forgot to mention that when switching to other modes the highlighting
> will also get confused and fly-make will report plenty of syntax problems.
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

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