From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96538 Path: news.gmane.org!.POSTED!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: filter module: call function before calling the filter command? Date: Thu, 13 Oct 2016 15:41:02 -0700 (PDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1806959398-1476398424=:19840" X-Trace: blaine.gmane.org 1476398506 10089 195.159.176.226 (13 Oct 2016 22:41:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Oct 2016 22:41:46 +0000 (UTC) User-Agent: Alpine 2.02 (OSX 1266 2009-07-14) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 14 00:41:42 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buoh1-0001eP-Mk for gctc-ntg-context-518@m.gmane.org; Fri, 14 Oct 2016 00:41:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 21EE31ACCF; Fri, 14 Oct 2016 00:41:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y_wrjcYHEAZb; Fri, 14 Oct 2016 00:41:20 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 84AF61ACD6; Fri, 14 Oct 2016 00:41:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E11291ACD3 for ; Fri, 14 Oct 2016 00:41:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sErCOop87OuW for ; Fri, 14 Oct 2016 00:41:17 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B1BD81ACCF for ; Fri, 14 Oct 2016 00:41:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2016-05-12; t=1476398464; bh=Lwz0Ee8Ql9hclBuxtad16UmNCjL4PSNcytMggIJQOf0=; h=Date:From:To:Subject:In-Reply-To:References; b=PZN0iKb1IeOtJejEoysIGvUWnlg3AfTNXwbIECMCrzLFdT7R0GmhIbBGHY5gdyVbD BUTFq3FEwQPfpdowLkZ/0NfIJ13P/TR5hSxJ6vg/+/yqPjTPQ7X7/+Rniu3qehGj/P MANT5DQ8KtSaCKrDzyShdxLnmF/bsF1XCi7rebAg5TShTTKtb7yebVPbyzPcEOZSaf c7JaWTXSz81m7CuLU6TbvMO1m9ro18ieFH7DvQxHK6UsaOG1KvLUiIo2ckdL+zAmqw oG9j9JuJBCbYLZNN+VlOqsBsJyVDEyj2bNBMNqlYRshPxNUIeKFQQ6Awon6Yu6dL2S hMYh/Uh+KYQmg== Authentication-Results: tombraider.mr.itd.umich.edu; iprev=pass policy.iprev=136.152.142.33 (airbears2-136-152-142-33.airbears2.berkeley.edu); auth=pass smtp.auth=adityam Original-Received: FROM airbears2-10-142-33-74.airbears2.1918.berkeley.edu (airbears2-136-152-142-33.airbears2.berkeley.edu [136.152.142.33]) By tombraider.mr.itd.umich.edu ID 58000D7F.D2334.18268; Authuser adityam; Thu, 13 Oct 2016 18:41:04 -0400 In-Reply-To: Content-ID: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:96538 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1806959398-1476398424=:19840 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-7; FORMAT=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Wed, 12 Oct 2016, Henning Hraban Ramm wrote: > Now, I=A2d like to overwrite "texsettings.ly", containing the setting of= =20 > ConTeXt=A2s text width, each time before I call LilyPond, to adapt its=20 > note line width to the current text width. That would automate the line= =20 > width adaption to e.g. columns. > > In the module=A2s documentation under "Dealing with expansion" I found th= e example of creating the filter command in a macro. > Can I use this to call a Lua function first and then LilyPond? Or is ther= e a better way? There is an internal option: filtersetups that may be useful for what you= =20 have in mind. You can create a lua function, say lilypond.initialize(...), that does all= =20 the initializations, and then write \startsetups lilypond:initialize \ctxlua{lilypond.initialize()} \stopsetups \defineexternalfilter[...] [ ... filtersetups=3Dlilypond:initialize, ... ] This is untested, but it should work. Aditya --0-1806959398-1476398424=:19840 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwOi8vZm91bmRyeS5zdXBl bGVjLmZyL3Byb2plY3RzL2NvbnRleHRyZXYvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRnYXJk ZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --0-1806959398-1476398424=:19840--