GNU bug report logs - #25905
25.1; Can't find regexp and replace in SVG files

Previous Next

Package: emacs;

Reported by: Matthias Meulien <matthias.meulien <at> delair-tech.com>

Date: Wed, 1 Mar 2017 00:25:01 UTC

Severity: minor

Tags: fixed

Found in version 25.1

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Matthias Meulien <matthias.meulien <at> delair-tech.com>, 25905 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> 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
[Message part 1 (text/plain, inline)]
>>> 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.

[inside-image.patch (text/x-diff, inline)]
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

This bug report was last modified 4 years and 229 days ago.

Previous Next


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