From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86586 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Trimming strings and Lua string.trim question Date: Thu, 6 Mar 2014 16:27:44 +0100 Message-ID: References: <5316ABF3.5050302@rik.users.panix.com> <5316DF28.3070300@wxs.nl> <53173D9E.1050907@rik.users.panix.com> <5678BF45-446A-4769-851C-1F587D37701C@gmail.com> <5317ACAB.4050904@rik.users.panix.com> <53185011.5070801@wxs.nl> <53188E93.9060408@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1394119676 16277 80.91.229.3 (6 Mar 2014 15:27:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2014 15:27:56 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Mar 06 16:28:03 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WLaDL-0000v5-CA for gctc-ntg-context-518@m.gmane.org; Thu, 06 Mar 2014 16:28:03 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A5B0F101FA; Thu, 6 Mar 2014 16:28:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tIoGKf9ljTdo; Thu, 6 Mar 2014 16:28:00 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 980BF101EF; Thu, 6 Mar 2014 16:28:00 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6BB92101EF for ; Thu, 6 Mar 2014 16:27:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ahz+5Khl5mmH for ; Thu, 6 Mar 2014 16:27:58 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 7778D101E1 for ; Thu, 6 Mar 2014 16:27:48 +0100 (CET) Original-Received: from mail-bk0-x22d.google.com (mail-bk0-x22d.google.com [IPv6:2a00:1450:4008:c01::22d]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s26Fi06o007863 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 6 Mar 2014 16:44:00 +0100 Original-Received: by mail-bk0-f45.google.com with SMTP id na10so737548bkb.32 for ; Thu, 06 Mar 2014 07:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=n1veGJ1Bob53Pt2McLzFYaE5Z/eFn1PCO1W6rHv8gIQ=; b=FQ5y5pSlCOqer7VRc6xaDgccq5wza3CwZbfrMtWPRjyvZgQJYCHqfoA9TLXAehJArF ZpzrXZhHOl/P6vSrzVGM0DstShsFasfpngZsENtUN7rnHfbMXz2LtHqMWpX2bfxQCfcT ZccMvzWIznWwFuwQY1y2h0SJGEPF/Q2Lztz7k3bf6BD9wFKs26heJVuqUZN7BNJCtZSk Pq/6CWIPoZnD/mV7/aPE8DlZ176r9xnrmlSSXTiYzMIdaFKCmHrqCsPbidjvKrwYp0HS Dj4BpKVpe6oPlumTPcz3JrSqmzVFqYuoFoTGmue8a/SBsl7zKu7qvc673G2/Iyk/9yAL 60Vg== X-Received: by 10.204.61.200 with SMTP id u8mr451653bkh.64.1394119667222; Thu, 06 Mar 2014 07:27:47 -0800 (PST) Original-Received: from keima.localdomain (x2f225d4.dyn.telefonica.de. [2.242.37.212]) by mx.google.com with ESMTPSA id oa10sm9816254bkb.14.2014.03.06.07.27.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Mar 2014 07:27:46 -0800 (PST) In-Reply-To: <53188E93.9060408@rik.users.panix.com> X-Mailer: Apple Mail (2.1874) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::22d; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01LyfI0iH - 4646e0e8fd12 - 20140306 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:86586 Archived-At: Am 06.03.2014 um 16:04 schrieb Rik Kabel : > Could you please ensure that this handles text in buffers the same way th= at it handles other strings? I noticed that this is handled a bit different= ly, as the following shows,but perhaps it is my clumsy coding. The buffer r= esult is closer to what I expect in terms of internal whitespace, but still= does not show expected trimming of leading and trailing whitespace. That t= rimming, of course, is the point of the exercise. This can=92t work because \getbuffer is a unexpandable command and what you= pass to Lua is the string \getbuffer[testbuffer] and not the content of the buffer. When you want to manipulate the content = of a buffer you have to access the content at the Lua side with the buffers= .getcontent(=85) function. BTW: You don=92t need \long in MkIV because definitions use it by default. Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________