all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tangling flow control
@ 2016-11-08 21:21 Philip Hudson
  2016-11-09 17:54 ` Charles C. Berry
  0 siblings, 1 reply; 7+ messages in thread
From: Philip Hudson @ 2016-11-08 21:21 UTC (permalink / raw)
  To: emacs orgmode-mailinglist

Thanks to Charles Berry and the "scraps" site curated by Eric Schulte
(is he on the list?), I now know how to do "branching" flow control
when tangling, by using a form that evals to either "no" or a filename
as the argument to the =:tangle= header.

How do you do "looping" flow control?

For context, what I'm trying to write is a single Org file from which
I can tangle out a number of =~/.ssh/config= files, one for each of
several hosts on a LAN. Within this file I need to repeatedly place a
template =BEGIN_SRC ssh-config= block, each time with a few words and
numbers changed. Do you do this anywhere? If so, how have you
implemented it?

I'm already at the point where I can do a dumb, brute-force version
with lots of near-identical blocks that I know will give me what I
need, so that's fine, but I like to keep things DRY.

It occurs to me that looping may simply not be what tangling is for,
and I need to look at levels of indirection. That is, tangle to a
bunch of intermediate Org files each of which tangles to a config
file: is that what you would recommend? Or transclude an Org file
containing my block template and perhaps somehow use tags and
=org-get-tags-at= to parameterize each inclusion? Anyone already doing
something like that?

-- 
Phil Hudson                  http://hudson-it.ddns.net
Pretty Good Privacy (PGP) ID: 0x887DCA63

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-10 10:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-08 21:21 Tangling flow control Philip Hudson
2016-11-09 17:54 ` Charles C. Berry
2016-11-09 20:32   ` Philip Hudson
2016-11-09 21:41     ` Charles C. Berry
2016-11-09 22:59       ` Philip Hudson
2016-11-10  1:19         ` Charles C. Berry
2016-11-10 10:36           ` Philip Hudson

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.