bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string


From: Filipp Gunbin
Subject: bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
Date: Wed, 07 Jul 2021 21:59:31 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin)

tags 49420 + patch
quit

On 05/07/2021 20:24 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Date: Mon, 05 Jul 2021 20:13:08 +0300
>> 
>> 
>> subst-char-in-region has its entry, but subst-char-in-string doesn't
>> have.  It's not clear to me what is the best node to add to: is it
>> "(elisp) Search and Replace"?
>
> I think right next to subst-char-in-region.

Something like this?

>From 290b521f7429bed6656a967da204205bbd94c0a3 Mon Sep 17 00:00:00 2001
From: Filipp Gunbin <fgunbin@fastmail.fm>
Date: Wed, 7 Jul 2021 21:51:57 +0300
Subject: [PATCH 2/2] ; * doc/lispref/text.texi (Substitution): Add
 subst-char-in-string (Bug#49420)

---
 doc/lispref/text.texi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 0c87a19fa1..f6484c4d37 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -4428,6 +4428,16 @@ Substitution
 @end example
 @end defun
 
+
+@defun subst-char-in-string fromchar tochar string &optional inplace
+@cindex replace characters in string
+This function replaces all occurences of the character @var{fromchar}
+with @var{tochar} in @var{string}.  Unless @var{inplace} is non-nil,
+substitution occurs in a copy of @var{string}.  In any case, the
+function returns the resulting string.  Both characters must have the
+same length of multi-byte form.
+@end defun
+
 @deffn Command translate-region start end table
 This function applies a translation table to the characters in the
 buffer between positions @var{start} and @var{end}.
-- 
2.32.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]