unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ideasman42@gmail.com
To: emacs-devel@gnu.org
Subject: Re: Bug/regression in regex-replace (was fix for bug#67124)
Date: Sat, 30 Nov 2024 13:49:24 +1100	[thread overview]
Message-ID: <6617d273-3f8a-4209-8ec6-ab378c14b450@gmail.com> (raw)
In-Reply-To: <775b1c65-081c-4a91-8a2d-4e7aba04b32c@gmail.com>

On 11/30/24 12:24 PM, Campbell Barton <ideasman42@gmail.com> wrote:
> Hi, the commit 47b497b4dac91e5ea56102018223bdeb5e21a93b by Stefan 
> Monnier (an alternate fix for bug#67124) has broken the evil-numbers 
> package [0], causing it's tests to fail.
> 
>  From a user perspective:
> `evil-numbers/dec-at-pt` on `0` to result in `1` instead of `-1`.
> 
> The change seems to be caused by (set-match-data ...)
> using passing in a pair of identical points (a match with zero length), 
> then a call to regex-replace to insert text into the empty match (the 
> numbers "sign" in this case).
> 
> I'm not sure if this would be considered a bug, or if creating an empty 
> group is considers incorrect use of the API, in that case - invalid 
> input might raise an error instead of failing silently.
> 
> Whatever the case this used to work - and the commit doesn't indicate 
> the change was intentional.
> 
> [0]: https://github.com/juliapath/evil-numbers

To follow up on this problem, this looks like a more typical bug since swapping the order,
so the empty match is replaced after the later, non-empty match still works,
so I assume it's preferred to handle this via the bug-tracker instead of the mailing list.



  reply	other threads:[~2024-11-30  2:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-30  1:24 Bug/regression in regex-replace (was fix for bug#67124) Campbell Barton
2024-11-30  2:49 ` ideasman42 [this message]
2024-11-30  7:24 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6617d273-3f8a-4209-8ec6-ab378c14b450@gmail.com \
    --to=ideasman42@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).