From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/44428 Path: news.gmane.org!not-for-mail From: Olivier Newsgroups: gmane.comp.tex.context Subject: passing buffer to lua functions Date: Mon, 29 Sep 2008 21:53:51 +0200 Message-ID: <20080929195351.GB14467@blackowl.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1222717995 28942 80.91.229.12 (29 Sep 2008 19:53:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Sep 2008 19:53:15 +0000 (UTC) To: ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 29 21:54:12 2008 connect(): Connection refused Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1KkOou-0006sX-45 for gctc-ntg-context-518@m.gmane.org; Mon, 29 Sep 2008 21:54:12 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E86551FDD1; Mon, 29 Sep 2008 21:53:06 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01186-02-2; Mon, 29 Sep 2008 21:52:16 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 44BE11FD8E; Mon, 29 Sep 2008 21:52:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0E7C21FD8D for ; Mon, 29 Sep 2008 21:52:09 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 31000-02-4 for ; Mon, 29 Sep 2008 21:51:22 +0200 (CEST) Original-Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by ronja.ntg.nl (Postfix) with ESMTP id 212C31FD8E for ; Mon, 29 Sep 2008 21:51:19 +0200 (CEST) Original-Received: from smtp6-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp6-g19.free.fr (Postfix) with ESMTP id C4C92197A3 for ; Mon, 29 Sep 2008 21:51:18 +0200 (CEST) Original-Received: from moramora (mic92-7-82-228-122-214.fbx.proxad.net [82.228.122.214]) by smtp6-g19.free.fr (Postfix) with ESMTP id A0F6217228 for ; Mon, 29 Sep 2008 21:51:12 +0200 (CEST) Original-Received: from vony by moramora with local (Exim 4.69) (envelope-from ) id 1KkOoZ-0003mn-1F for ntg-context@ntg.nl; Mon, 29 Sep 2008 21:53:51 +0200 Mail-Followup-To: ConTeXt users Content-Disposition: inline X-Operating-System: "Debian GNU/Linux" User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:44428 Archived-At: Dear all, I'm trying to implement a very simple filter mechanism in lua like this: \def\test#1{% \startlua local pipe, str pipe = io.popen("./my_filter '\luaescapestring{#1}'", "r") str = pipe:read("*a") tex.print(str) pipe:close() \stoplua } \test{% line 1 line 2 } The issue I have is that the argument of test has its line breaks removed in the process (i.e. the filter my_filter sees a single line argument). How to prevent this while keeping the lua escape at the same time? (I know I can implement such a thing with executecommand and using buffers written to files, but I would like to avoid writing on the hard disk.) Olivier ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________