GNU bug report logs - #54733
Match again in perform-replace

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Tue, 5 Apr 2022 17:41:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 54733 <at> debbugs.gnu.org
Subject: bug#54733: Match again in perform-replace
Date: Fri, 24 Jun 2022 20:25:05 +0300
>>>> +				(replace-search search-string limit
>>>> +						regexp-flag delimited-flag
>>>> +						case-fold-search backward))
>>>
>>> I don't know this code too well, but perhaps SEARCH_STRING here should be
>>> anchored with something like "\\=" at the beginning?
>>>
>>> Otherwise the search can succeed here even if the next match is not
>>> here. Not sure how important that is, though.
>>
>> I'm afraid that prepending "\\=" might break a complex regexp somehow.
>
> Another variant without modifying the original regexp is still to call
> replace-search, but afterwards check if it stayed at the old position

A third variant is to add a new variable `looking-at-function'
that is like `isearch-search-fun-function', so everyone who needs
to redefine the search function, will also need to redefine
the looking-at function.




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

Previous Next


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