From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EMJ4AFQ2818xYQAA0tVLHw (envelope-from ) for ; Mon, 04 Jan 2021 15:37:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eA+5N1M2818gDAAA1q6Kng (envelope-from ) for ; Mon, 04 Jan 2021 15:37:55 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 559BE9402D4 for ; Mon, 4 Jan 2021 15:37:55 +0000 (UTC) Received: from localhost ([::1]:37660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwRvd-0001Qw-TK for larch@yhetil.org; Mon, 04 Jan 2021 10:37:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwRuq-0001Q9-LN for emacs-orgmode@gnu.org; Mon, 04 Jan 2021 10:37:04 -0500 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:33582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwRun-00060l-G8 for emacs-orgmode@gnu.org; Mon, 04 Jan 2021 10:37:04 -0500 Received: by mail-io1-xd2c.google.com with SMTP id w18so25401881iot.0 for ; Mon, 04 Jan 2021 07:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KZpJxHaNY7ye9hCn87f4lXQULDGs4hJndpF0C9ogyX4=; b=I4C9ve0JIxNc265Ge4psMoCL9+8Z1jAycZwhchUJxS5EBkab+3MO5yvEZEYWAYcDbm 3K66AHiV2wFSk9pfZfnUUF8ng1kTVYDbwCc/gSSsO5kizIj8L8CFGpV32s9jvgFgX5u3 jG2uP6nLD7zkAgroXmZEYgQL5nEBTTeRynom/rgVShvLwBFOtsSxW8iQxsYAKsM5mN7p O3VeE/VzSifL0wSxFlyjysOnWQVmjpIzlN4AGunOmM9ZK8Rh1tNU19oLbtRJ22MpT4iX SjVQx9EzPMMeNo/2mC50IkyfPTXdUIITJuSuu/ukZX0d2I6Zz7Y1KUTalVhDUJ3sBCUc AkRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KZpJxHaNY7ye9hCn87f4lXQULDGs4hJndpF0C9ogyX4=; b=AFczYZEb/zLYUIJcDrpHcSyOC0iLpaEcUMWSRIdgoc4T1Msl8WsucsQHY2OvHA4JGF 2680K3TGVM0DfBwmeB1hW3I81/aifQqmE9pBPS5CN7lbaklNnAGMHsNyUAXuzp5IH5eC t2sTPPxehALebn7bfxbJcfBDZahWZh+XaKumBxCCO/nol6neVtsnfF4WP77Uw6AeHUxV rYiyT2NbYtLkUmlJ2E1pI+vKjJB5NeJ9MDiy118rKUh0euORjhF9+19HQ1a/Kx+NqgRW XatEkptEpBJnity7ydC1VwOz41ou09pCCJw2Ms+8XWkNN+cxdAhMmmCANRJnww1X9Bhf XtBw== X-Gm-Message-State: AOAM533big1pSo6vSjfs2ceDwtLSH8xDF1A4sePrPQEL2tKWjsa/W4pI Hlzs8x3E98EZg784umjLa2kx+VghvDAY99IQ0Q== X-Google-Smtp-Source: ABdhPJxHXzlN54zTsBbjZSlurgx9mZbauRc/v1u59wr25qZS2v2Qba14zxR2jm9UiGmqwO4GAkhDZA/FPsXPN+Wh53o= X-Received: by 2002:a02:7f41:: with SMTP id r62mr62725465jac.17.1609774620369; Mon, 04 Jan 2021 07:37:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Immanuel Litzroth Date: Mon, 4 Jan 2021 16:36:24 +0100 Message-ID: Subject: Re: ist here a :post header arg for tangling? To: Diego Zamboni Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::d2c; envelope-from=immanuel.litzroth@gmail.com; helo=mail-io1-xd2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gmauer@gmail.com, emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.03 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=I4C9ve0J; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 559BE9402D4 X-Spam-Score: -2.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZhfSdHB/4oys Oh and I also made the tangling itself more flexible in that you can now also choose to only tangle stuff going to a certain file. This is mainly to= be able to define an interactive command that tangles/reloads everything going to the file under point. Immanuel On Mon, Jan 4, 2021 at 4:31 PM Immanuel Litzroth wrote: > > Well I solved the problem by writing a tangler which can be configured > with tangle-config > you define a tangler by making a hash "language" -> tangle-hooks. The > tangle-hooks are > called at beginning of tangling, on each source block, on each > noweb-ref and at the end of > tangling. They receive the full source-block-info to do their work, > and in the case of noweb-references > they receive the full stack of sbi's that lead up to this noweb reference= . > >>> > (tangled-buffer "Buffer that is being tangled") > (name "Name of the code block") > (tangle-file "Filename to tangle to") > (properties "Properties of this block") > (full-block "Text of the full block") > (beg-block "Buffer pos of beginning of the block in the tangled buffer") > (end-block "end of the block in the tangled buffer") > (lang "language of the tangled buffer") > (beg-lang "beginning of the language in the tangled buffer") > (end-lang "end of the language in the tangled buffer") > (switches "switches of this block") > (beg-switches "begin of the switches in this block") > (end-switches "end of the switches in this block") > (header-args "header args of this block") > (beg-header-args "buffer pos of header args beginning") > (end-header-args "buffer pos of header args end") > (body "body of the tangled block") > (beg-body "buffer pos of the beginning of the body") > (end-body "buffer pos of the end of the body")) > >>> > That way I can tangle a multi language org file and do the correct thing = for > each of the language by defining functions of interest. It's quite > flexible, I'm > going to use it to do some aspect-oriented programming/tangling when I > find the time. > Immanuel > > On Mon, Jan 4, 2021 at 4:11 PM Diego Zamboni wrote: > > > > Agree. It should be possible to make the hook file-local, but still it'= s not trivial to have good control over where and how the changes are made. > > > > --Diego > > > > > > On Mon, Jan 4, 2021 at 3:51 PM Immanuel Litzroth wrote: > >> > >> There's that, but you're not gonna do much with that since it is > >> global to emacs. If you're brimming > >> with vigour you might achieve what you want by rebinding that each > >> time you tangle to do the correct > >> thing. Not much information is available in that hook, you get dropped > >> into a temp buffer containing the > >> result of tangling. > >> Immanuel > >> > >> On Mon, Jan 4, 2021 at 3:07 PM Diego Zamboni wrot= e: > >> > > >> > There's =3Dorg-babel-post-tangle-hook=3D, which AFAICT specifies hoo= ks that will be run with the tangled code in a temporary buffer. I couldn't= find much documentation nor examples, but it is mentioned at https://orgmo= de.org/manual/Extracting-Source-Code.html#Hooks-3 > >> > > >> > --Diego > >> > > >> > > >> > > >> > > >> > > >> > On Fri, Jan 1, 2021 at 1:31 PM Immanuel Litzroth wrote: > >> >> > >> >> I don't think there is an arg for that. I have written a tangler th= at > >> >> reuses a lot > >> >> of the org-babel machinery and has a more flexible mechanism to dec= ide what > >> >> to do with the tangled code -- I use it for example to not write a > >> >> tangled file if it > >> >> hasn't changed, meaning that it will not trigger recompile. > >> >> The project is private now but if you're interested I can give you = access to it. > >> >> What exactly are you trying to do? > >> >> Immanuel > >> >> > >> >> On Fri, Jan 1, 2021 at 2:09 AM George Mauer wrot= e: > >> >> > > >> >> > I'd like to run some code to post-process files after they are ta= ngled. Is there a header-arg for that? > >> >> > >> >> > >> >> > >> >> -- > >> >> -- Researching the dual problem of finding the function that has a > >> >> given point as fixpoint. > >> >> > >> > >> > >> -- > >> -- Researching the dual problem of finding the function that has a > >> given point as fixpoint. > > > > -- > -- Researching the dual problem of finding the function that has a > given point as fixpoint. --=20 -- Researching the dual problem of finding the function that has a given point as fixpoint.