emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Rainer@krugs.de
Cc: Bastien <bzg@gnu.org>,
	emacs-orgmode@gnu.org, Nick Daly <nick.m.daly@gmail.com>
Subject: Re: Feature Request: Allow Tangling Named INCLUDEs
Date: Mon, 27 Jan 2014 07:37:08 -0700	[thread overview]
Message-ID: <87lhy1v5t6.fsf@gmail.com> (raw)
In-Reply-To: 52E6265F.2060500@krugs.de

Rainer M Krug <Rainer@krugs.de> writes:

> On 01/27/14, 01:44 , Nick Daly wrote:
>> Hi Bastien,
>>
>>> Nick Daly wrote:
>>>
>>>> Hi folks, I have a situation where I have many named code
>>>> snippets currently available in external files, and would like
>>>> to tangle them into an Org mode file.
>>
>> Bastien writes:
>>> I'm not the one who would undertake this, so my opinion on this
>>> should not matter much... but I think #+INCLUDE is well suited
>>> for exporting, not for tangling.  I'm not able to say why, this
>>> is just an intuition.
>>
>> It seems to me like it's trying to unify exporting and tangling:
>> this emphasizes that tangling is just another (very specific
>> plain-text) form of exporting.
>
> I agree here - I also see tangling as just a different export backend.
>
> I must say I like the idea of having #+INCLUDE expanded before export,
> as it would make using code libraries much easier. But one could even
> go one step further: not only include the complete file, but only a
> named source block - that would be perfect.
>
> Just wondering - wouldn't it be possible, to just put the function
> org-export-expand-include-keyword into the pre-tangle-hook?
>

Why don't you try it out and let us know.

>
> Cheers,
>
> Rainer
>
>> Using Eric's function for exporting allows me to remove lots of
>> boilerplate code from the source org file and keep the org source
>> better focused on the code's function and structure.
>>
>> Sure it's weird, but it sure is handy.
>>
>> Nick
>>
>
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel :       +33 - (0)9 53 10 27 44
> Cell:       +33 - (0)6 85 62 59 98
> Fax :       +33 - (0)9 58 10 27 44
>
> Fax (D):    +49 - (0)3 21 21 25 22 44
>
> email:      Rainer@krugs.de
>
> Skype:      RMkrug

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

  reply	other threads:[~2014-01-27 14:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-11 21:04 Feature Request: Allow Tangling Named INCLUDEs Nick Daly
2014-01-19 16:01 ` Bastien
2014-01-27  0:44   ` Nick Daly
2014-01-27  9:26     ` Rainer M Krug
2014-01-27 14:37       ` Eric Schulte [this message]
2014-01-28  8:12         ` Rainer M Krug
2014-01-27 14:40     ` Eric Schulte
2014-01-20 16:19 ` Eric Schulte
2014-01-27  0:36   ` Nick Daly
2014-01-20 16:20 ` 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=87lhy1v5t6.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=Rainer@krugs.de \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=nick.m.daly@gmail.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).