GNU bug report logs - #75345
29.4; 'insert' doc string still mentions 'string-as-multibyte'

Previous Next

Package: emacs;

Reported by: Ulrich Müller <ulm <at> gentoo.org>

Date: Sat, 4 Jan 2025 09:51:02 UTC

Severity: normal

Found in version 29.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75345 in the body.
You can then email your comments to 75345 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75345; Package emacs. (Sat, 04 Jan 2025 09:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ulrich Müller <ulm <at> gentoo.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 04 Jan 2025 09:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Müller <ulm <at> gentoo.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.4; 'insert' doc string still mentions 'string-as-multibyte'
Date: Sat, 04 Jan 2025 10:50:04 +0100
[Message part 1 (text/plain, inline)]
C-h f insert RET

   insert is a built-in function in ‘src/editfns.c’.

   [...]

   When operating on binary data, it may be necessary to preserve the
   original bytes of a unibyte string when inserting it into a multibyte
   buffer; to accomplish this, apply ‘string-as-multibyte’ to the string
   and insert the result.

C-h f string-as-multibyte RET

   string-as-multibyte is a built-in function in ‘src/fns.c’.

   This function is obsolete since 26.1; use `decode-coding-string'.

   [...]

This looks inconsistent, presumably 'insert' shouldn't mention
'string-as-multibyte'. Attached patch updates the doc string.

Also, the elisp manual still mentions functions string-as-unibyte and
string-as-multibyte in section "(elisp) Top > Non-ASCII Characters >
Selecting a Representation". Should these be removed from the manual,
or at least be labelled as obsolete?

[0001-Update-insert-doc-string.patch (text/plain, inline)]
From 858f94f942cb40481ac8bc83a36ae5555066c1bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm <at> gentoo.org>
Date: Sat, 4 Jan 2025 10:37:59 +0100
Subject: [PATCH] Update 'insert' doc string

* src/editfns.c (Finsert): Mention 'decode-coding-string' instead
of the obsolete 'string-as-multibyte' in doc string.
---
 src/editfns.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/editfns.c b/src/editfns.c
index 581bd03798e..8a5fb673fe7 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1363,8 +1363,8 @@ DEFUN ("insert", Finsert, Sinsert, 0, MANY, 0,
 
 When operating on binary data, it may be necessary to preserve the
 original bytes of a unibyte string when inserting it into a multibyte
-buffer; to accomplish this, apply `string-as-multibyte' to the string
-and insert the result.
+buffer; to accomplish this, apply `decode-coding-string' with the
+`no-conversion' coding system to the string and insert the result.
 
 usage: (insert &rest ARGS)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
-- 
2.47.1


Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 04 Jan 2025 13:34:01 GMT) Full text and rfc822 format available.

Notification sent to Ulrich Müller <ulm <at> gentoo.org>:
bug acknowledged by developer. (Sat, 04 Jan 2025 13:34:02 GMT) Full text and rfc822 format available.

Message #10 received at 75345-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ulrich Müller <ulm <at> gentoo.org>
Cc: 75345-done <at> debbugs.gnu.org
Subject: Re: bug#75345: 29.4;
 'insert' doc string still mentions 'string-as-multibyte'
Date: Sat, 04 Jan 2025 15:32:59 +0200
> From: Ulrich Müller <ulm <at> gentoo.org>
> Date: Sat, 04 Jan 2025 10:50:04 +0100
> 
> C-h f insert RET
> 
>    insert is a built-in function in ‘src/editfns.c’.
> 
>    [...]
> 
>    When operating on binary data, it may be necessary to preserve the
>    original bytes of a unibyte string when inserting it into a multibyte
>    buffer; to accomplish this, apply ‘string-as-multibyte’ to the string
>    and insert the result.
> 
> C-h f string-as-multibyte RET
> 
>    string-as-multibyte is a built-in function in ‘src/fns.c’.
> 
>    This function is obsolete since 26.1; use `decode-coding-string'.
> 
>    [...]
> 
> This looks inconsistent, presumably 'insert' shouldn't mention
> 'string-as-multibyte'. Attached patch updates the doc string.

Thanks, installed on emacs-30, and closing the bug.

> Also, the elisp manual still mentions functions string-as-unibyte and
> string-as-multibyte in section "(elisp) Top > Non-ASCII Characters >
> Selecting a Representation". Should these be removed from the manual,
> or at least be labelled as obsolete?

I'm not yet convinced these functions should be removed from the
manual.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Feb 2025 12:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 190 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.