GNU bug report logs - #45516
26.3; (elisp) `Modifying Strings': Mention `replace-regexp-in-string'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 28 Dec 2020 23:12:01 UTC

Severity: normal

Tags: fixed

Found in version 26.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 45516 in the body.
You can then email your comments to 45516 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#45516; Package emacs. (Mon, 28 Dec 2020 23:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 28 Dec 2020 23:12:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; (elisp) `Modifying Strings': Mention `replace-regexp-in-string'
Date: Mon, 28 Dec 2020 15:11:16 -0800 (PST)
Subject line says it all.  This is an important function for modifying
strings.  Please consider mentioning it, with a cross-reference.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.18362
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45516; Package emacs. (Tue, 29 Dec 2020 01:20:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 45516 <at> debbugs.gnu.org
Subject: Re: bug#45516: 26.3; (elisp) `Modifying Strings': Mention
 `replace-regexp-in-string'
Date: Tue, 29 Dec 2020 02:19:45 +0100
Drew Adams <drew.adams <at> oracle.com> writes:

> Subject line says it all.  This is an important function for modifying
> strings.  Please consider mentioning it, with a cross-reference.

That node is about destructively modifying strings.
replace-regexp-in-string doesn't modify anything -- it returns a new
string.

But it's odd that there's no mention of replace-regexp-in-string (and
string-replace) in the Strings section, so I've now added a reference
from the Creating Strings node.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 29 Dec 2020 01:21:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 45516 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 29 Dec 2020 01:21:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45516; Package emacs. (Tue, 29 Dec 2020 02:34:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 45516 <at> debbugs.gnu.org
Subject: RE: bug#45516: 26.3; (elisp) `Modifying Strings': Mention
 `replace-regexp-in-string'
Date: Mon, 28 Dec 2020 18:33:50 -0800 (PST)
> > Subject line says it all.  This is an important function for modifying
> > strings.  Please consider mentioning it, with a cross-reference.
> 
> That node is about destructively modifying strings.
> replace-regexp-in-string doesn't modify anything -- it returns a new
> string.
> 
> But it's odd that there's no mention of replace-regexp-in-string (and
> string-replace) in the Strings section, so I've now added a reference
> from the Creating Strings node.

Yes, you're right that the functions described
there are about destructively modifying.  And
thanks for making some changes for this bug.

But nothing is said in that node about the
kind of modification ("destructive") that's
involved.  A user can want to either modify
in place or return a new string that's the
same as some other string but with some
changes.  In some cases a user doesn't care
which is done.

I think there's room for doc improvement, for
helping users finding functions that "modify"
in either sense, and for making clear just
which kind of "modifying" is meant for each case.

You have a string "abcdefbca", and you want a
string that is the same, but with "bc" replaced
by "xy".  What do you ask for in the Elisp
manual, to find the info you need?




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 26 Jan 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 88 days ago.

Previous Next


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