From: Lars Ingebrigtsen <larsi@gnus.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Matthias Meulien <matthias.meulien@delair-tech.com>,
25905@debbugs.gnu.org
Subject: bug#25905: 25.1; Can't find regexp and replace in SVG files
Date: Sun, 13 Dec 2020 13:42:29 +0100 [thread overview]
Message-ID: <87a6uh6fnu.fsf@gnus.org> (raw)
In-Reply-To: <9f8916a2-293e-16c9-4a3c-f69f215a7fa2@yandex.ru> (Dmitry Gutov's message of "Sat, 12 Dec 2020 23:29:20 +0200")
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 12.12.2020 21:56, Lars Ingebrigtsen wrote:
>> But I wonder whether this problem should nevertheless have a general
>> solution. That is, should this command have a variation that works on
>> literal files instead? Perhaps a prefix of `C-u' to make the query
>> replace use find-file-literally?
>
> Perhaps there could be a whitelist of such modes instead, with
> commands that can be used to switch buffer contents to "replacable"
> form?
>
> At least in this particular example, it's hard for me to imagine users
> *not* wanting the replacements work by default. So it makes sense as
> the default behavior.
That's true. There's probably not a lot of these formats -- svg,
xpm... uhm... the pnm formats, possibly? that are "text-like" enough
that people would want to perform search-replaces on them, so writing a
whitelist would probably not be a big job.
So this command would use that whitelist to bind those formats to
fundamental-mode? Or it could be on auto-mode-alist form:
(defvar query-replace-overriding-mode-alist
'(("\\.svgz?\\'" . image-mode-as-text)
("\\.x[bp]m\\'" . image-mode-as-text)
("\\.p[bpgn]m\\'" . image-mode-as-text)))
That would make this trivial to implement. Comments?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2020-12-13 12:42 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6uh6fnu.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=25905@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--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 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.