From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Matthias Meulien <matthias.meulien@delair-tech.com>,
25905@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#25905: 25.1; Can't find regexp and replace in SVG files
Date: Fri, 18 Dec 2020 00:03:11 +0200 [thread overview]
Message-ID: <875z50gkf4.fsf@mail.linkov.net> (raw)
In-Reply-To: <87mtyeycdr.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 15 Dec 2020 22:42:40 +0200")
[-- Attachment #1: Type: text/plain, Size: 777 bytes --]
>>> There is also the dired-do-isearch command that searches in marked files.
>>>
>>> OTOH, when such "making text visible to search" would be implemented
>>> for isearch, then it will be used automatically by query-replace that
>>> relies on the same search functions.
>>
>> That's true...
>>
>> So we basically need some new functionality for switching to text mode
>> in image buffers when we're doing searches?
>
> Maybe isearch-open-necessary-overlays should detect if there is an image
> over point, then switch the buffer to text mode.
Here is one possible fix, but I'm still unsure if using image functions
in isearch is a good style. Perhaps a better fix would be to add this
code to a buffer-local isearch-mode-hook in image-mode.el that runs
when isearch starts.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: inside-image.patch --]
[-- Type: text/x-diff, Size: 653 bytes --]
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 0d5c480c8d..12d31d49a7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -3573,6 +3573,11 @@ isearch-close-unnecessary-overlays
(defun isearch-range-invisible (beg end)
"Return t if all the text from BEG to END is invisible."
+ (let ((inside-image (and (derived-mode-p 'image-mode)
+ (fboundp 'image-get-display-property)
+ (image-get-display-property))))
+ (when (and inside-image (fboundp 'image-mode-as-text))
+ (image-mode-as-text)))
(when (/= beg end)
;; Check that invisibility runs up to END.
(save-excursion
next prev parent reply other threads:[~2020-12-17 22:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-01 0:20 bug#25905: 25.1; Can't find regexp and replace in SVG files Matthias Meulien
2020-12-12 19:56 ` Lars Ingebrigtsen
2020-12-12 20:24 ` Juri Linkov
2020-12-13 12:35 ` Lars Ingebrigtsen
2020-12-12 21:29 ` Dmitry Gutov
2020-12-13 12:42 ` Lars Ingebrigtsen
2020-12-13 18:39 ` Dmitry Gutov
2020-12-13 20:02 ` Juri Linkov
2020-12-14 16:21 ` Lars Ingebrigtsen
2020-12-14 19:55 ` Juri Linkov
2020-12-15 6:34 ` Lars Ingebrigtsen
2020-12-15 20:42 ` Juri Linkov
2020-12-17 22:03 ` Juri Linkov [this message]
2020-12-18 8:46 ` Juri Linkov
2020-12-18 10:02 ` Lars Ingebrigtsen
2020-12-19 20:29 ` Juri Linkov
2020-12-23 7:13 ` Lars Ingebrigtsen
2020-12-23 9:30 ` Juri Linkov
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=875z50gkf4.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=25905@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=larsi@gnus.org \
--cc=matthias.meulien@delair-tech.com \
/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).