From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Feature Request: Allow Tangling Named INCLUDEs Date: Tue, 28 Jan 2014 09:12:28 +0100 Message-ID: <52E7666C.1070103@krugs.de> References: <87ob3ifcx4.fsf@gmail.com> <877g9w9d10.fsf@bzg.ath.cx> <87ob2y5k3o.fsf@gmail.com> <52E6265F.2060500@krugs.de> <87lhy1v5t6.fsf@gmail.com> Reply-To: Rainer@krugs.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W83ml-0002C2-1s for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 03:12:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W83mf-0001XQ-KY for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 03:12:42 -0500 In-Reply-To: <87lhy1v5t6.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Bastien , emacs-orgmode@gnu.org, Nick Daly -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/27/14, 15:37 , Eric Schulte wrote: > Rainer M Krug 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. OK - did it. It expands the #+INCLUDE in the actual org buffer, so they are expanded after the tangleing, which is not exactly what one wants. Cheers, Rainer > >> >> 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 > - -- 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJS52ZsAAoJENvXNx4PUvmCoDMIALThdsiEVeTS+19WAQftcJNu lW5e210lpMv3KOT4FmP1dKC7Js2sX8U9uc7XsgRfgmz+2jtNKfaCv5ZpqUx2Hwcp qFtYiojX1N4PrgbTjbJMsbGfM68UaFt9G+p02WtsZRgJY0OSK0TmcJ+OiHx7ejFf juR/I6ZmJfpgoeLFilKN4RlNk6wVQ2mzvMxFqDMJiTPjdT07zXPCW+RJX9HPZbC2 tCGMrUvaUIM20idVmnN86KEMwtWyw2kqGQYl5yMboVa7mbALOx2SHiDjukmmaVTh ocwYnAcZxyhPesO7t6jAS7ZVaYZxRpLTGaj2yhShM0XI/T5fCy0jlF07vtvhrcw= =DXxi -----END PGP SIGNATURE-----