unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: pinmacs@cas.cat, rpluim@gmail.com, 75116@debbugs.gnu.org,
	visuweshm@gmail.com
Subject: bug#75116: [PATCH] Make 'yank-media' autoselect the best media type
Date: Mon, 06 Jan 2025 21:15:31 +0200	[thread overview]
Message-ID: <867c7769f0.fsf@gnu.org> (raw)
In-Reply-To: <8734hvhifj.fsf@localhost> (message from Ihor Radchenko on Mon, 06 Jan 2025 19:05:20 +0000)

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: visuweshm@gmail.com, 75116@debbugs.gnu.org, pinmacs@cas.cat,
>  rpluim@gmail.com
> Date: Mon, 06 Jan 2025 19:05:20 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> >>>     User asks to autoselect:
> >> >>>       1. autoselect-function (a-s-f) returns one media type: we yank it.
> >> >>
> >> >> Yes.
> >> >>
> >> >>>       2. a-s-f returns multiple media types: we ask the user which one
> >> >>>          to yank.
> >> >>
> >> >> No, we use the first one.
> > ...
> > That's what I mean by "ask": use the default behavior of the command.
> >
> > Conceptually, it's the same as the paste operation in other
> > applications: by default, the application decides which of the formats
> > to use, and if the user wants to choose, he/she needs to pop up a menu
> > of available formats in some way and select from there.
> 
> I see the logic.
> 
> I still find returning a list of mimetypes useful though - if user wants
> to implement an additional filter on top of a-s-f provided by major
> mode, having a list of mimetypes as input is more flexible.

We could leave the selection to the command level, and have the
function return a list in all the cases.

> But we need to document that the final choice will be taken as the first
> element from what a-s-f (possibly adviced) returns.

Under the default behavior of auto-selecting one type, yes.  The
function should therefore arrange for the first type to be the most
reasonable/useful one.





      reply	other threads:[~2025-01-06 19:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-26 12:27 bug#75116: [PATCH] Make 'yank-media' autoselect the best media type Visuwesh
2024-12-26 15:49 ` Eli Zaretskii
2024-12-27  8:58   ` Visuwesh
2024-12-28 12:24     ` Eli Zaretskii
2025-01-06  4:37       ` Visuwesh
2025-01-06 14:10         ` Eli Zaretskii
2025-01-06 18:33         ` Ihor Radchenko
2025-01-06 18:50           ` Eli Zaretskii
2025-01-06 19:05             ` Ihor Radchenko
2025-01-06 19:15               ` Eli Zaretskii [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867c7769f0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=75116@debbugs.gnu.org \
    --cc=pinmacs@cas.cat \
    --cc=rpluim@gmail.com \
    --cc=visuweshm@gmail.com \
    --cc=yantar92@posteo.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).