From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Truncated print Date: Sun, 03 Jan 2010 13:22:10 +0100 Message-ID: References: <87bphc9i9s.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262521308 20089 80.91.229.12 (3 Jan 2010 12:21:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2010 12:21:48 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jan 03 13:21:40 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NRPSl-0001ZZ-VK for guile-devel@m.gmane.org; Sun, 03 Jan 2010 13:21:40 +0100 Original-Received: from localhost ([127.0.0.1]:38557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRPSm-0000zq-CV for guile-devel@m.gmane.org; Sun, 03 Jan 2010 07:21:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRPSf-0000zf-8U for guile-devel@gnu.org; Sun, 03 Jan 2010 07:21:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRPSa-0000yI-Sg for guile-devel@gnu.org; Sun, 03 Jan 2010 07:21:32 -0500 Original-Received: from [199.232.76.173] (port=60228 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRPSa-0000yE-KO for guile-devel@gnu.org; Sun, 03 Jan 2010 07:21:28 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:40170 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRPSS-0003Ex-Rt; Sun, 03 Jan 2010 07:21:21 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id F307D8D549; Sun, 3 Jan 2010 07:21:19 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Bu9/438NjAwL oxhx0aXKUMM8Lqs=; b=wgP3xZcX89ZWmh8cHRLHfHTymWQqHzovJNlDjvVh00kZ 0owspi998FIAyOm8b3KiqpE5OBxTe40+OaqH4y3Z8eYG6/2tqVZoKiYJek6JXyWD ICd0LK7E7Lk2Nbf8kcTRG5NsmksJO2La6I7Ur8RRDgztPIE6BJk5BFuIvBwyAc4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=oKAs8l UX2XGp8aAasQ2vGPBssVbr8CwGL44AoCfux0N7Y9rt2r9zBVCUJr9XUlf8pjzWmH G0gB0Varik2tIAVBL/0ElNGhAuTIO59660HZXeUga6pGoJGjb+RkPf6J8vnDSZ+8 GWgJHfBrAOR1WeryLeDQGWLlHxZo/ixeoMtB4= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id B979F8D548; Sun, 3 Jan 2010 07:21:18 -0500 (EST) Original-Received: from unquote (unknown [82.123.112.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 55B898D547; Sun, 3 Jan 2010 07:21:16 -0500 (EST) In-Reply-To: <87bphc9i9s.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 03 Jan 2010 00:52:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 7EE65AC8-F862-11DE-8DC8-9D59EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9817 Archived-At: Hello :) On Sun 03 Jan 2010 00:52, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> commit b8596c08ac2ef2201c1e8559ac5f4d62ebde3d91 >> Author: Andy Wingo >> Date: Tue Dec 29 13:26:41 2009 +0100 >> >> add ~@y truncated printing directive to format > > Nice! Can you please add test cases, e.g., based on the examples added > to the manual? Sure, will do. >> +(truncated-print "The quick brown fox" #:width 10) (newline) >> +@print{} "The quick brown..." > > I think it=E2=80=99d be nice to default to =E2=80=98HORIZONTAL ELLIPSIS= =E2=80=99 (U+2026). > Perhaps the ellipsis string could be a keyword parameter? Having it be a keyword parameter would complicate things somewhat, as there are some hardcoded lengths in there. It could work. But perhaps a bigger problem is that if you're in a non-unicode locale -- *as Guile is by default, without a call to setlocale* -- the `=E2=80=A6' will expand to `...', which uses up more characters, thus the "truncated" part of things doesn't work as advertised. So either we play games with locale conversion (OK, but complicated), or we setlocale() at the beginning and punt on the issue. See http://lists.gnu.org/archive/html/guile-devel/2009-12/msg00025.html. Given Mike's mail, I think we should be calling setlocale(). What do you think? Andy --=20 http://wingolog.org/