all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Image-conversion shims
Date: Mon, 30 Sep 2019 06:12:03 +0200	[thread overview]
Message-ID: <8736gea0do.fsf@gnus.org> (raw)
In-Reply-To: <83eezzfh8c.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 29 Sep 2019 14:56:51 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Uhm...  what about...  image-use-external-converter?
>
> SGTM.

OK; done.

> But that means the command strings are restricted in what they can
> use, because split-string has some limitations that aren't immediately
> evident.  So if you want to leave this stuff as-is, at least we should
> say something in the doc string of image-converter--converters to that
> effect that; e.g., I think quotes should not be allowed there.

Stefan M. suggested using a list instead of a string, and I think I'll
make that adjustment.

> Maybe.  It sounds a bit too convoluted to me, and I hoped for a
> simpler solution...

Me too, but I don't see one at the moment.

> Actually, why not simply add the relevant extensions to
> auto-mode-alist, causing them to invoke image-mode?

But when do we do that?  To determine what the list of supported formats
is, we have to run `image-converter--probe' (etc).  But we don't know
whether we need to do that until we know that we're going to load an
unsupported image format.  :-/

I.e., we want ("*.webp" . image-mode) in auto-mode-alist, but we can't
put it there before we've called "gm convert -list format", and we don't
do that until we call `create-image' with image-use-external-converter
non-nil, which won't be called since we don't have a mapping from
"*.webp" to image-mode.

Very chicken and egg.

Hm...  One possibility would be to do away with

(setq image-use-external-converter t)

as a user-level thing, and instead tell them to do

(image-external-converter-mode)

in ~/.emacs, which would do the probing and then altering
auto-mode-alist.  Hm.  Perhaps that's a pretty clean idea?  Hm...  I
think so.  Except that switching the mode off would have to remove the
entries from auto-mode-alist again, which sounds slightly destructive.

Uhm.  Perhaps map .wepb etc to a new image-mode-external that should
just be a mode that inherits from image-mode, but would do nothing if
the image-external-converter-mode has been toggled off?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



  reply	other threads:[~2019-09-30  4:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-28 20:06 Image-conversion shims Lars Ingebrigtsen
2019-09-28 20:37 ` Clément Pit-Claudel
2019-09-28 21:20   ` Lars Ingebrigtsen
2019-09-29  6:24   ` Eli Zaretskii
2019-09-28 21:05 ` Stefan Monnier
2019-09-28 21:21   ` Lars Ingebrigtsen
2019-09-28 23:29   ` Lars Ingebrigtsen
2019-09-29  0:01     ` Lars Ingebrigtsen
2019-09-29  7:11     ` Eli Zaretskii
2019-09-29 11:44       ` Lars Ingebrigtsen
2019-09-29 11:56         ` Eli Zaretskii
2019-09-30  4:12           ` Lars Ingebrigtsen [this message]
2019-09-30  7:06             ` Eli Zaretskii
2019-09-30 13:42               ` Lars Ingebrigtsen
2019-09-30 14:01                 ` Eli Zaretskii
2019-10-01 12:06                   ` Lars Ingebrigtsen
2019-10-01 12:36                     ` Eli Zaretskii
2019-09-30 17:27             ` Stefan Monnier
2019-10-01 12:08               ` Lars Ingebrigtsen
2019-10-01 13:09                 ` Stefan Monnier
2019-10-06 20:58             ` Juri Linkov
2019-10-07  1:41               ` Lars Ingebrigtsen
2019-10-07 18:48                 ` Juri Linkov
2019-10-08 16:06                   ` Lars Ingebrigtsen
2019-10-08 17:47                     ` Stefan Monnier
2019-10-09 19:26                       ` Lars Ingebrigtsen
2019-10-09 19:53                         ` Stefan Monnier
2019-10-14  4:53                           ` Lars Ingebrigtsen
2019-10-14 19:27                             ` Juri Linkov
2019-10-14 19:41                               ` Lars Ingebrigtsen

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=8736gea0do.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.