all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: pinmacs <pinmacs@cas.cat>,  rpluim@gmail.com,  emacs-devel@gnu.org
Subject: Re: yank-media: allow users to limit image types that can be inserted
Date: Tue, 24 Sep 2024 10:38:53 +0530	[thread overview]
Message-ID: <87ikulwsd6.fsf@gmail.com> (raw)
In-Reply-To: <8634lqfcaf.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Sep 2024 21:35:52 +0300")

[திங்கள் செப்டம்பர் 23, 2024] Eli Zaretskii wrote:

>> Date: Mon, 23 Sep 2024 15:00:54 -0300
>> Cc: visuweshm@gmail.com, emacs-devel@gnu.org
>> From: pinmacs <pinmacs@cas.cat>
>> 
>> Before yank-media, I was using org-download [1], so I got used to just 
>> insert a screenshot with no question to answer (such as the type of the 
>> image).
>> 
>> Recently, I moved to yank-media, but to have the same functionality, I 
>> had to tweak it a little bit, full detail here [2].
>> 
>> I see utility on asking for the image/png and image/jpeg and here you 
>> have details why you would care about [3].
>
> This just says that PNG is always preferable to JPEG if both are
> available.  As I already said, I'm okay with the idea of having C-y or
> similar key to decide which format to use, and so what you are saying
> (and I agree) that it should always choose PNG if Emacs supports it.
>
> What I still do not understand is what would be the reason for the
> user to prefer JPEG over PNG.  More generally, if Emacs can support N
> formats out of those available in the clipboard, why would the user
> want to be shown only 1 < M < N out of them?

[ The more I think about this, the more I believe the choice of
  "preferred formats" will change depending on the scenario where
  yank-media is used.  In Org, I could see "don't bother asking me, just
  use PNG if available" could be useful.  But somewhere in HTML mode,
  "always ask me" could be the right choice.  ]

> Furthermore, your request was even more broad and general: it asked
> for some filtering infrastructure, and I'm still trying to understand
> why that would be needed.  The discussion to which you point on the
> Org list doesn't explain the rationale, either.
>
> Bottom line: I'm okay with offering two yank-media alternatives:
>
> (1) via a command that selects a single most appropriate format based
> on some (yet to be defined) algorithm; and

What about a user option yank-media-preferred-mimetypes which is a list
of mimetypes that the user would like to always opt for, given the
choice?

. If there is only mimetype available, then we simply choose that type's
  handler without consulting the user option.

. If there are more than one mimetype available, we pick those mimetypes
  that are in the user option.

    . If more than one mimetype from the user option is matched, we ask
      the user what format, among the matched, they want to use.
    . If none of the mimetypes available match those in the user option,
      we again ask the user to choose from all available formats (we
      delegate to option (2) below)


> (2) via showing the list of all the formats that the running Emacs
> supports and asking the user to choose one.

This is what we already have so nothing to be changed.

> If we can agree on this, we should now discuss those algorithms for
> selecting a single media type.
>
> Thanks.



  parent reply	other threads:[~2024-09-24  5:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-22 16:53 yank-media: allow users to limit image types that can be inserted pinmacs
2024-09-23 11:20 ` Eli Zaretskii
2024-09-23 13:46   ` Visuwesh
2024-09-23 14:30     ` Eli Zaretskii
2024-09-23 15:06       ` Visuwesh
2024-09-23 15:48         ` Eli Zaretskii
2024-09-23 15:09       ` Robert Pluim
2024-09-23 15:14         ` Visuwesh
2024-09-23 15:20           ` Robert Pluim
2024-09-23 15:58           ` Eli Zaretskii
2024-09-24  5:00             ` Visuwesh
2024-09-24  5:10               ` Visuwesh
2024-09-24 11:57               ` Eli Zaretskii
2024-09-24 12:42                 ` Visuwesh
2024-09-23 15:54         ` Eli Zaretskii
2024-09-23 16:10           ` Robert Pluim
2024-09-23 16:34             ` Eli Zaretskii
2024-09-23 18:00               ` pinmacs
2024-09-23 18:35                 ` Eli Zaretskii
2024-09-23 20:45                   ` Pedro
2024-09-23 21:08                   ` pinmacs
2024-09-24  8:15                     ` Robert Pluim
2024-09-24 11:30                     ` Eli Zaretskii
2024-09-24 12:18                       ` Robert Pluim
2024-09-24 13:08                         ` Eli Zaretskii
2024-09-24 13:38                           ` Visuwesh
2024-09-24 13:50                             ` Eli Zaretskii
2024-09-24  5:08                   ` Visuwesh [this message]
2024-09-24 12:00                     ` Eli Zaretskii
2024-09-24 12:50                       ` Visuwesh
2024-09-24 13:23                         ` Eli Zaretskii
2024-09-24 13:37                           ` Visuwesh
2024-09-23 18:11               ` Eli Zaretskii
2024-09-24  8:38                 ` Robert Pluim

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=87ikulwsd6.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=pinmacs@cas.cat \
    --cc=rpluim@gmail.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.