guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Truncated print


From: Andy Wingo
Subject: Re: Truncated print
Date: Sun, 03 Jan 2010 13:22:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hello :)

On Sun 03 Jan 2010 00:52, address@hidden (Ludovic Courtès) writes:

>> commit b8596c08ac2ef2201c1e8559ac5f4d62ebde3d91
>> Author: Andy Wingo <address@hidden>
>> Date:   Tue Dec 29 13:26:41 2009 +0100
>>
>>     add address@hidden 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)
>> address@hidden "The quick brown..."
>
> I think it’d be nice to default to ‘HORIZONTAL ELLIPSIS’ (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
`…' 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
-- 
http://wingolog.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]