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: Sun, 27 Oct 2024 12:09:31 +0200

> From: Visuwesh <visuweshm@gmail.com>
> Cc: Ihor Radchenko <yantar92@posteo.net>,  pinmacs@cas.cat,
>  rpluim@gmail.com,  emacs-devel@gnu.org
> Date: Sun, 27 Oct 2024 15:06:36 +0530
> 
> [ஞாயிறு அக்டோபர் 27, 2024] Eli Zaretskii wrote:
> 
> >> From: Ihor Radchenko <yantar92@posteo.net>
> >> Cc: visuweshm@gmail.com, pinmacs@cas.cat, rpluim@gmail.com, 
> >> emacs-devel@gnu.org
> >> Date: Sun, 27 Oct 2024 08:17:22 +0000
> >> 
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> 
> >> 1. clipboard contains 2 MIME types: image/png, image/bmp
> >> 2. clipboard contains 1 MIME type: image/png
> >> 3. clipboard contains 1 MIME type: image/bmp
> >> 
> >> We want to handle all three scenarios in the following way:
> >> 1. Select image/png (prefer it over image/bmp)
> >> 2. Select image/png
> >> 3. Select image/bmp (there is no image/png that we would prefer otherwise)
> >> 
> >> In all three cases, we do not want to prompt user about mimetype choice.
> >> 
> >> How can we do it using the existing Elisp API?
> >
> > Examine the available TARGETS, then bind
> > yank-media--registered-handlers to the appropriate value when invoking
> > yank-media.
> 
> Would that not defeat the point of yank-media, which is to present a
> simple, common interface to the clipboard data to major-mode authors?

Which part of the above would "defeat the point of yank-media", and
why?

> This approach also means that we would end up with org-yank-media,
> html-yank-media, etc. which does not sound better.

If Org has its own ideas about what's best for the users in some
situations, and if the users agree with that, I don't see what is
wrong with that.  The common interface presented by yank-media to
major modes is there so that major modes could use it in whichever
ways they think is best for their users.  So I see no problems in
major modes deciding to prefer some handlers over others, not in
principle.



reply via email to

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