GNU bug report logs -
#64178
replace-regexp ignoring value of org-search-invisible
Previous Next
Full log
View this message in rfc822 format
Juri Linkov <juri <at> linkov.net> writes:
>> It is natural to expect that zero-width matches are considered invisible
>> when the surrounding text is invisible.
>>
>> Also, is this documented anywhere?
>
> This corner case doesn't seem to be documented. Probably not for
> emacs-29, but something like this would require more testing:
>
> ...
> (defun isearch-range-invisible (beg end)
> "Return t if all the text from BEG to END is invisible."
> - (when (/= beg end)
> + (when t
`when' becomes redundant here.
The rest of the patch looks reasonable.
The patch makes sense in general, although the patch will not solve the
particular scenario we have here.
In my reproducer, we have
(defun test()<invisible begin>\n\t"This is test")\n<invisible end>\n
Note how the first newline after test() is hidden.
With the patch, Emacs will perform replacement at the final "\n" only,
while users will expect that "$" belongs to the previous visible line.
Similarly, "^"/"\<" are expected to match the next visible line/symbol.
While I do understand that the way Emacs will treat the above is
logical (albeit not intuitive), but may it be possible to make
interactive isearch use closer to what users expect?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
This bug report was last modified 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.