2012-03-10 Eli Zaretskii <eliz@gnu.org>
+ * strings.texi (String Basics):
+ * sequences.texi (Sequence Functions): Mention that `length' is
+ not appropriate for computing the string width on display; add a
+ cross-reference to the description of `string-width'. (Bug#10978)
+
* eval.texi (Autoloading): Minor change of wording.
2012-03-10 Chong Yidong <cyd@gnu.org>
@noindent
See also @code{string-bytes}, in @ref{Text Representations}.
+If you need to compute the width of a string on display, you should
+use @code{string-width} (@pxref{Width}), not @code{length}, since
+@code{length} only counts the number of characters, but does not
+account for the display width of each character.
+
@defun elt sequence index
@cindex elements of sequences
This function returns the element of @var{sequence} indexed by
operate on them with the general array and sequence functions.
(@xref{Sequences Arrays Vectors}.) For example, you can access or
change individual characters in a string using the functions @code{aref}
-and @code{aset} (@pxref{Array Functions}).
+and @code{aset} (@pxref{Array Functions}). However, note that
+@code{length} should @emph{not} be used for computing the width of a
+string on display; use @code{string-width} (@pxref{Width}) instead.
There are two text representations for non-@acronym{ASCII} characters in
Emacs strings (and in buffers): unibyte and multibyte (@pxref{Text