emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: LanX <lanx.perl@googlemail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Embedding org-syntax in program source
Date: Tue, 13 Apr 2010 10:47:15 -0600	[thread overview]
Message-ID: <87zl17guzw.fsf@gmail.com> (raw)
In-Reply-To: <l2yec36f5051004130840rb9b433b2kf3b4140a8faf1e55@mail.gmail.com> (LanX's message of "Tue, 13 Apr 2010 17:40:25 +0200")

LanX <lanx.perl@googlemail.com> 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.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-04-13 16:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13 10:32 Embedding org-syntax in program source LanX
2010-04-13 15:08 ` Eric Schulte
     [not found]   ` <y2wec36f5051004130835k5d850907h35f6645b5f5fef17@mail.gmail.com>
2010-04-13 15:40     ` LanX
2010-04-13 16:47       ` Eric Schulte [this message]
2010-04-13 21:31       ` Dan Davison
2010-04-13 23:54         ` LanX
2010-04-14 12:39           ` Sebastian Rose
2010-04-14 15:22           ` Dan Davison
2010-04-13 16:12 ` Dan Davison

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=87zl17guzw.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=lanx.perl@googlemail.com \
    /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).