emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: yank-media: allow users to limit image types that can be inserted


From: Eli Zaretskii
Subject: Re: yank-media: allow users to limit image types that can be inserted
Date: Mon, 23 Sep 2024 18:54:25 +0300

> From: Robert Pluim <rpluim@gmail.com>
> Cc: Visuwesh <visuweshm@gmail.com>,  pinmacs@cas.cat,  emacs-devel@gnu.org
> Date: Mon, 23 Sep 2024 17:09:03 +0200
> 
>     Eli> IMO, for users we already have what is needed: when we detect several
>     Eli> formats, we show them to the user and ask him/her to tell us which
>     Eli> format he/she wants to use.
> 
> But that requires user interaction. I think the original request could
> be summed up as "if the list contains image/png, donʼt ask me, just
> insert the image".

That's not how I understand the request.  It was not always PNG, it
was "sometimes PNG, but if so-and-so-happens, the JPEG" etc.

I'm okay with having C-y select one format, if we can come up with
some reasonable default, but we need to discuss the algorithm to
arrive at that default.  And if the suggestion is to let users write a
function to make that decision, then I'm squarely against that,
because providing such functions is the job of Lisp programs.

>     Eli> The issue at hand here, AFAIU, is not the UI, but how Lisp programs
>     Eli> (and Org in particular) can control this.  If the issue is the user
>     Eli> interface, then I honestly don't understand what issue is being
>     Eli> brought up, because in that case we already have the correct and
>     Eli> comprehensive solution, similar to what other advanced apps do in
>     Eli> these cases.
> 
> You have to register the yank-media-handler before the yank-media
> call, so org canʼt control this: it has to register for "image/.*"
> because it canʼt know what formats will be presented to it. I guess it
> could have a user option to filter the results from inside its
> yank-media-handler, but then *every* package that wants to support
> image yanking will have to implement something similar: we should just
> implement such handling in the yank-media code.

How else would you pull such a trick?

And no one has explained yet why I would prefer PNG to JPEG or vice
versa, btw.  The usual choices I'm familiar with is whether or not to
preserve typefaces, colors, and other fancy attributes; regarding
images, there's just a decision whether you want to paste the material
as a picture or as some kind of text, whether rich or not.  So the
background and the context for this request is still not clear to me.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]