unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
@ 2021-07-05 17:13 Filipp Gunbin
  2021-07-05 17:24 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Filipp Gunbin @ 2021-07-05 17:13 UTC (permalink / raw)
  To: 49420


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

Thanks.


In GNU Emacs 28.0.50 (build 10, x86_64-apple-darwin20.5.0, NS appkit-2022.50 Version 11.4 (Build 20F71))
 of 2021-07-05 built on fgunbin.local
Repository revision: 82c6327555252a00404c62302dcc9effbf8fb90a
Repository branch: master
System Description:  macOS 11.4





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

* bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
  2021-07-05 17:13 bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string Filipp Gunbin
@ 2021-07-05 17:24 ` Eli Zaretskii
  2021-07-07 18:59   ` Filipp Gunbin
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-07-05 17:24 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 49420

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





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

* bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
  2021-07-05 17:24 ` Eli Zaretskii
@ 2021-07-07 18:59   ` Filipp Gunbin
  2021-07-10 17:00     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Filipp Gunbin @ 2021-07-07 18:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 49420

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1162 bytes --]

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


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

* bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
  2021-07-07 18:59   ` Filipp Gunbin
@ 2021-07-10 17:00     ` Lars Ingebrigtsen
  2021-07-10 17:16       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-10 17:00 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 49420

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> Something like this?

Thanks; applied to Emacs 28.

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





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

* bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
  2021-07-10 17:00     ` Lars Ingebrigtsen
@ 2021-07-10 17:16       ` Eli Zaretskii
  2021-07-11  8:18         ` Basil L. Contovounesios
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-07-10 17:16 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: fgunbin, 49420

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  49420@debbugs.gnu.org
> Date: Sat, 10 Jul 2021 19:00:24 +0200
> 
> Filipp Gunbin <fgunbin@fastmail.fm> writes:
> 
> > Something like this?
> 
> Thanks; applied to Emacs 28.

Thanks.  I made a minor fix in this change: the part about both
characters having to have the same multibyte length is incorrect (that
restriction is only applicable to subst-char-in-region).  I also fixed
the sentence with double negation ("Unless ... non-nil, ...".)

Sorry I missed the original patch.





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

* bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
  2021-07-10 17:16       ` Eli Zaretskii
@ 2021-07-11  8:18         ` Basil L. Contovounesios
  2021-07-11 10:16           ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2021-07-11  8:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Lars Ingebrigtsen, fgunbin, 49420

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi@gnus.org>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  49420@debbugs.gnu.org
>> Date: Sat, 10 Jul 2021 19:00:24 +0200
>> 
>> Filipp Gunbin <fgunbin@fastmail.fm> writes:
>> 
>> > Something like this?
>> 
>> Thanks; applied to Emacs 28.
>
> Thanks.  I made a minor fix in this change: the part about both
> characters having to have the same multibyte length is incorrect (that
> restriction is only applicable to subst-char-in-region).  I also fixed
> the sentence with double negation ("Unless ... non-nil, ...".)

Thanks, but did you forget to push the fix?

-- 
Basil





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

* bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string
  2021-07-11  8:18         ` Basil L. Contovounesios
@ 2021-07-11 10:16           ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-07-11 10:16 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: larsi, fgunbin, 49420

> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,  fgunbin@fastmail.fm,
>   49420@debbugs.gnu.org
> Date: Sun, 11 Jul 2021 09:18:46 +0100
> 
> > Thanks.  I made a minor fix in this change: the part about both
> > characters having to have the same multibyte length is incorrect (that
> > restriction is only applicable to subst-char-in-region).  I also fixed
> > the sentence with double negation ("Unless ... non-nil, ...".)
> 
> Thanks, but did you forget to push the fix?

Oops!





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

end of thread, other threads:[~2021-07-11 10:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 17:13 bug#49420: 28.0.50; Add elisp manual entry for subst-char-in-string Filipp Gunbin
2021-07-05 17:24 ` Eli Zaretskii
2021-07-07 18:59   ` Filipp Gunbin
2021-07-10 17:00     ` Lars Ingebrigtsen
2021-07-10 17:16       ` Eli Zaretskii
2021-07-11  8:18         ` Basil L. Contovounesios
2021-07-11 10:16           ` Eli Zaretskii

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).