* Bug/regression in regex-replace (was fix for bug#67124)
@ 2024-11-30 1:24 Campbell Barton
2024-11-30 2:49 ` ideasman42
2024-11-30 7:24 ` Eli Zaretskii
0 siblings, 2 replies; 3+ messages in thread
From: Campbell Barton @ 2024-11-30 1:24 UTC (permalink / raw)
To: emacs-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug/regression in regex-replace (was fix for bug#67124)
2024-11-30 1:24 Bug/regression in regex-replace (was fix for bug#67124) Campbell Barton
@ 2024-11-30 2:49 ` ideasman42
2024-11-30 7:24 ` Eli Zaretskii
1 sibling, 0 replies; 3+ messages in thread
From: ideasman42 @ 2024-11-30 2:49 UTC (permalink / raw)
To: emacs-devel
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug/regression in regex-replace (was fix for bug#67124)
2024-11-30 1:24 Bug/regression in regex-replace (was fix for bug#67124) Campbell Barton
2024-11-30 2:49 ` ideasman42
@ 2024-11-30 7:24 ` Eli Zaretskii
1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2024-11-30 7:24 UTC (permalink / raw)
To: Campbell Barton; +Cc: emacs-devel
> Date: Sat, 30 Nov 2024 12:24:01 +1100
> From: Campbell Barton <ideasman42@gmail.com>
>
> 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.
Thanks, but please in the future report bugs using "M-x report-emacs-bug".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-30 7:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30 1:24 Bug/regression in regex-replace (was fix for bug#67124) Campbell Barton
2024-11-30 2:49 ` ideasman42
2024-11-30 7:24 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.