GNU bug report logs - #49420
28.0.50; Add elisp manual entry for subst-char-in-string

Previous Next

Package: emacs;

Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>

Date: Mon, 5 Jul 2021 17:14:01 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

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 49420 in the body.
You can then email your comments to 49420 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#49420; Package emacs. (Mon, 05 Jul 2021 17:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Filipp Gunbin <fgunbin <at> fastmail.fm>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 05 Jul 2021 17:14:01 GMT) Full text and rfc822 format available.

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

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Add elisp manual entry for subst-char-in-string
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"?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49420; Package emacs. (Mon, 05 Jul 2021 17:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 49420 <at> debbugs.gnu.org
Subject: Re: bug#49420: 28.0.50;
 Add elisp manual entry for subst-char-in-string
Date: Mon, 05 Jul 2021 20:24:00 +0300
> From: Filipp Gunbin <fgunbin <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49420; Package emacs. (Wed, 07 Jul 2021 19:00:02 GMT) Full text and rfc822 format available.

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

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 49420 <at> debbugs.gnu.org
Subject: Re: bug#49420: 28.0.50; Add elisp manual entry for
 subst-char-in-string
Date: Wed, 07 Jul 2021 21:59:31 +0300
[Message part 1 (text/plain, inline)]
tags 49420 + patch
quit

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

>> From: Filipp Gunbin <fgunbin <at> 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?

[0002-doc-lispref-text.texi-Substitution-Add-subst-char-in.patch (text/x-diff, inline)]
From 290b521f7429bed6656a967da204205bbd94c0a3 Mon Sep 17 00:00:00 2001
From: Filipp Gunbin <fgunbin <at> 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


Added tag(s) patch. Request was from Filipp Gunbin <fgunbin <at> fastmail.fm> to control <at> debbugs.gnu.org. (Wed, 07 Jul 2021 19:00:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49420; Package emacs. (Sat, 10 Jul 2021 17:01:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 49420 <at> debbugs.gnu.org
Subject: Re: bug#49420: 28.0.50; Add elisp manual entry for
 subst-char-in-string
Date: Sat, 10 Jul 2021 19:00:24 +0200
Filipp Gunbin <fgunbin <at> 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




bug marked as fixed in version 28.1, send any further explanations to 49420 <at> debbugs.gnu.org and Filipp Gunbin <fgunbin <at> fastmail.fm> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 10 Jul 2021 17:01:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49420; Package emacs. (Sat, 10 Jul 2021 17:18:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: fgunbin <at> fastmail.fm, 49420 <at> debbugs.gnu.org
Subject: Re: bug#49420: 28.0.50; Add elisp manual entry for
 subst-char-in-string
Date: Sat, 10 Jul 2021 20:16:43 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  49420 <at> debbugs.gnu.org
> Date: Sat, 10 Jul 2021 19:00:24 +0200
> 
> Filipp Gunbin <fgunbin <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49420; Package emacs. (Sun, 11 Jul 2021 08:19:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, fgunbin <at> fastmail.fm,
 49420 <at> debbugs.gnu.org
Subject: Re: bug#49420: 28.0.50; Add elisp manual entry for
 subst-char-in-string
Date: Sun, 11 Jul 2021 09:18:46 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>,  49420 <at> debbugs.gnu.org
>> Date: Sat, 10 Jul 2021 19:00:24 +0200
>> 
>> Filipp Gunbin <fgunbin <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49420; Package emacs. (Sun, 11 Jul 2021 10:17:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: larsi <at> gnus.org, fgunbin <at> fastmail.fm, 49420 <at> debbugs.gnu.org
Subject: Re: bug#49420: 28.0.50; Add elisp manual entry for
 subst-char-in-string
Date: Sun, 11 Jul 2021 13:16:36 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>,  fgunbin <at> fastmail.fm,
>   49420 <at> 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!




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

This bug report was last modified 2 years and 262 days ago.

Previous Next


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