summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-13 06:18:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-13 06:18:32 -0700
commit48e0e179ca9579eca414804aa4f8e7ae8fb040bb (patch)
treebccbaf5cf1764989f394e866661c7ff114fa4318 /txr.1
parent0a2ef84a7a1c5e898c9fbf7c9e84a65d965212c6 (diff)
downloadtxr-48e0e179ca9579eca414804aa4f8e7ae8fb040bb.tar.gz
txr-48e0e179ca9579eca414804aa4f8e7ae8fb040bb.tar.bz2
txr-48e0e179ca9579eca414804aa4f8e7ae8fb040bb.zip
New display-width function.
* eval.c (eval_init): Register display-width intrinsic. * lib.c (display_width): New function. * lib.h (display_width): Declared. * txr.1: Documented display-width.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.127
1 files changed, 27 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index e9bf5832..d788c6bb 100644
--- a/txr.1
+++ b/txr.1
@@ -27328,6 +27328,33 @@ results in no output at all. This effectively means that an arbitrarily nested
structure of lists and vectors is printed flattened, with one element on each
line.
+.coNP Function @ display-width
+.synb
+.mets (display-width << char )
+.mets (display-width << string )
+.syne
+.desc
+The
+.code display-width
+function calculates the number of places occupied by the printed representation
+of
+.meta char
+or
+.metn string
+on a monospace display which renders certain characters, such as the East Asian
+kanji and other characters, using two places.
+
+For a
+.meta string
+argument, this value is the sum of the individual display width of the
+string's constituent characters. The display width of an empty string is zero.
+
+Control characters are assigned a display width of zero, regardless of
+their display control semantics, if any.
+
+Characters marked by Unicode as being wide or full width, have a display
+width of two. Other characters have a display width of one.
+
.coNP Function @ streamp
.synb
.mets (streamp << obj )