unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45516: 26.3; (elisp) `Modifying Strings': Mention `replace-regexp-in-string'
@ 2020-12-28 23:11 Drew Adams
  2020-12-29  1:19 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2020-12-28 23:11 UTC (permalink / raw)
  To: 45516

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''





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

* bug#45516: 26.3; (elisp) `Modifying Strings': Mention `replace-regexp-in-string'
  2020-12-28 23:11 bug#45516: 26.3; (elisp) `Modifying Strings': Mention `replace-regexp-in-string' Drew Adams
@ 2020-12-29  1:19 ` Lars Ingebrigtsen
  2020-12-29  2:33   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-29  1:19 UTC (permalink / raw)
  To: Drew Adams; +Cc: 45516

Drew Adams <drew.adams@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





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

* bug#45516: 26.3; (elisp) `Modifying Strings': Mention `replace-regexp-in-string'
  2020-12-29  1:19 ` Lars Ingebrigtsen
@ 2020-12-29  2:33   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2020-12-29  2:33 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 45516

> > 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?





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

end of thread, other threads:[~2020-12-29  2:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 23:11 bug#45516: 26.3; (elisp) `Modifying Strings': Mention `replace-regexp-in-string' Drew Adams
2020-12-29  1:19 ` Lars Ingebrigtsen
2020-12-29  2:33   ` Drew Adams

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).