all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#55801: [PATCH] Fix documentation of `aset' on strings, `store-substring'
@ 2022-06-05  3:30 Richard Hansen
  2022-06-05  8:30 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Hansen @ 2022-06-05  3:30 UTC (permalink / raw)
  To: 55801


[-- Attachment #1.1.1: Type: text/plain, Size: 218 bytes --]

See attached patch:

* doc/lispref/strings.texi (Modifying Strings): `aref` and
`store-substring` automatically convert the string to multibyte if
necessary, and support characters with different sized encodings.

[-- Attachment #1.1.2: 0001-Fix-documentation-of-aset-on-strings-store-substring.patch --]
[-- Type: text/x-patch, Size: 1987 bytes --]

From 64c0d992e4ca5b820a87b6bcd3efc60cf266d2a4 Mon Sep 17 00:00:00 2001
From: Richard Hansen <rhansen@rhansen.org>
Date: Sat, 4 Jun 2022 23:25:11 -0400
Subject: [PATCH] Fix documentation of `aset' on strings, `store-substring'

* doc/lispref/strings.texi (Modifying Strings): `aref` and
`store-substring` automatically convert the string to multibyte if
necessary, and support characters with different sized encodings.
---
 doc/lispref/strings.texi | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 413e17750e..82bed43e4e 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -466,9 +466,11 @@ Modifying Strings
   The most basic way to alter the contents of an existing string is with
 @code{aset} (@pxref{Array Functions}).  @code{(aset @var{string}
 @var{idx} @var{char})} stores @var{char} into @var{string} at index
-@var{idx}.  Each character occupies one or more bytes, and if @var{char}
-needs a different number of bytes from the character already present at
-that index, @code{aset} signals an error.
+@var{idx}.  Unibyte strings are converted to multibyte if necessary
+(@pxref{Text Representations}).  If the size of the internal encoding
+of @var{char} differs from that of the character already present at
+@var{idx}, the string's representation is adjusted to accommodate the
+change.
 
   A more powerful function is @code{store-substring}:
 
@@ -478,9 +480,7 @@ Modifying Strings
 may be either a character or a (smaller) string.
 
 Since it is impossible to change the length of an existing string, it is
-an error if @var{obj} doesn't fit within @var{string}'s actual length,
-or if any new character requires a different number of bytes from the
-character currently present at that point in @var{string}.
+an error if @var{obj} doesn't fit within @var{string}'s actual length.
 @end defun
 
   To clear out a string that contained a password, use
-- 
2.36.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-05 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-05  3:30 bug#55801: [PATCH] Fix documentation of `aset' on strings, `store-substring' Richard Hansen
2022-06-05  8:30 ` Eli Zaretskii
2022-06-05 19:22   ` Richard Hansen
2022-06-05 19:27     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.